A form to set parameters for a query but can't select all...

mackyrm

Registered User.
Local time
Today, 10:52
Joined
Oct 5, 2006
Messages
57
I have a form with several combo boxes and date fields that form the parameters for query. I would like to be able to 'select all' records, as well as provide the options from my combo boxes. Is there a way to do this using just the query manager and the form (with the fields linking to the combo boxes)?
 
If you want to be able to return all the data or what you have selected from your combo's then use the Like[Formname]![ComboName]&"*" as your criteria in the query.
 
query manager and the form...

Yes, until you said...

(with the fields linking to the combo boxes)

Then no.

To achieve what you want, you must use VBA. You would put a button on your form then when its clicked you would have VBA to open the query (https://msdn.microsoft.com/en-us/library/office/ff192746.aspx?f=255&MSPPError=-2147217396), build a filter string based on your inputs and then apply that filter (https://msdn.microsoft.com/en-us/library/office/ff197651.aspx) using VBA.

The issue with Trevor's solution is that it will not work for NULL values.
 
Thanks guys, both answers are informative, but you are correct plog, I want to include all results for those fields, even if the vale is null.
 

Users who are viewing this thread

Back
Top Bottom