I have a couple of queries made where there are a limited possable number of searchable names.. What I would like to be able to do is have the user just select from a list of possable searches when the query is ran.
How about a form with a combobox for the names and then have a query taking the choice from the form and use it as criteria? In your query, on the criteria line underneath the appropriate field, you'd type something like:
[Forms]![Timeline_Input_Form]![mmcid] or in general
[Forms]![FormName]![FormComboBoxName]
Note: The form must remain open. But you can hide it, or minimize it.
After they choose a name, you can have a command button to run the query which will pick up the needed info from the form.
Actually I guess that I would have to create a macro that runs the final query and closes the form that I used to select the information for the query after the query is finished?
I gave your suggestion a try but for some reason the query is not taking the criteria from the form fields. I will have to give it a try again tonight when I get home.
I'm not exactly sure what you're doing. You mean they check a box and that selection becomes criteria for a query?
The following code shows how to use an Option Group selection. Maybe you can figure out what you need.
[RptFrame] is the name of the Option Group
Case 1, 2, 3 are the options in the group in order top to bottom.
Dim WClause, RName
Select Case [RptFrame]
Case 1
WClause = "[DateOfLease] Between #" & _
Me![Start] & "# AND #" & _
Me![End] & "#"
RName = "Sales_And_Leasing_Rpt"
Case 2
WClause = "[FinalSettlementDate]is null"
RName = "Sales_And_Leasing_Rpt"
Case 3
WClause = "[FinalSettlementDate] Between #" & _
Me![Start] & "# AND #" & _
Me![End] & "#"
RName = "Sales_Report"
End Select
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.