Filter Query with more than 1 variable problem

hardrock

Registered User.
Local time
Today, 00:31
Joined
Apr 5, 2007
Messages
166
Can someone help me with this filter query problem i have?

My query contains a criteria [forms]![buyform]![Grp]

Grp is set up as an invisible text box on my form called 'buyform'

Problem i have is i want to be able to sort my query records using multiple variables.

For instance in my code, if i set Grp = "Paul", then the query will filter all the records with Grp set to Paul this works fine, but if i set Grp = "Paul And John" i get no output.

How do i fix my query such that i can pass more than 1 condition to it from my VBA code?

Thanks
 
Last edited:
One way is to create a text box for each distinct value of grp. Then in your query use the in function where each value is the text box on the form.

ie

IN(Forms!yourForm!txt1,Forms!yourForm!txt2..............)

I have not tried this so may not work.
 

Users who are viewing this thread

Back
Top Bottom