Is there any way to mix tow logical condition in docmd.openForm criteria?

uniqe02us

New member
Local time
Today, 18:08
Joined
Oct 10, 2012
Messages
4
Hi
How can I use two criteria in docmd.OpenForm? There any way? :confused:
 
Hi
How can I use two criteria in docmd.OpenForm? There any way? :confused:
Yes, with something like:
DoCmd.OpenForm "F1", , , "[TextFieldNameInTable] = 'harry' and [NumberFieldNameInTable] = 3"
 
thanks a lot bob.its so useful for me but i have another problem now!
I try to use an variable value in the where condition .i try this command : ...,"[TextFieldNameInTable] = ' "& var1 &" ' and [NumberFieldNameInTable] = ' "& var2 & " ' "
and its not work. could u help me to fix it ?
 
Numbers don't need quotes round them and don't put spaces between the quotes for strings. It should be

,"[TextFieldNameInTable] = '" & var1 & "' and [NumberFieldNameInTable] = " & var2

and of course you need to replace those field names and variables with real ones or access won't recognise them.
 

Users who are viewing this thread

Back
Top Bottom