Hello Everyone,
I'm trying to use VBA to run a query with the query criteria being pulled from the values contained in textboxes on the same form. I know how to run the query with no criteria:
And I know the concept of a wildcard (*) in a query, but I'm not sure how to combine these concepts. Using the picture shown below for example, I am trying to click the button that says "Report" called "ResultsBtn" to query all rows in a table. Using the attached image as an example, I want to try to add to my code above so that I would run the "Results" query to show all items that...
Thanks in advance to whomever takes the time to help me. I used to know how to do this, but haven't looked at Access/VBA for several years!
I'm trying to use VBA to run a query with the query criteria being pulled from the values contained in textboxes on the same form. I know how to run the query with no criteria:
VBA Code:
Private Sub ResultsBtn_Click()
DoCmd.OpenQuery ("Results")
End Sub
And I know the concept of a wildcard (*) in a query, but I'm not sure how to combine these concepts. Using the picture shown below for example, I am trying to click the button that says "Report" called "ResultsBtn" to query all rows in a table. Using the attached image as an example, I want to try to add to my code above so that I would run the "Results" query to show all items that...
- have 10 in the partNumber somewhere in the input textbox to the right called "PartInput"
- Has a date between the dates given in the two input textboxes called "FromDate" and "ToDate"
- (I think I can figure out the other criteria shown in the screenshot if I get assistance on the above two points)
Thanks in advance to whomever takes the time to help me. I used to know how to do this, but haven't looked at Access/VBA for several years!