multiple whereconditions

WindSailor

Registered User.
Local time
Today, 14:17
Joined
Oct 29, 2003
Messages
235
I am having trouble running more than one wherecondition on a form that opens up a report. I recieve a "Type Mismatch" no matter how I code it for 2 or more conditions, but if I list them seperately and run one at a time the code works fine.
Combo8 is where the user picks the report to open.
"Comp" and "Gender" are the criteria to sort by.

Here are two different styles I have tried of many;

DoCmd.OpenReport Me.Combo8.Value, acViewPreview, ,_
"Comp = '" & Me.Combo1.Value & "'" And_
"Gender ='" & Me.Combo25.Value & "'"


Dim strCriteria as String
strCriteria = "Comp ='" & Me.Combo1.Value & "'" And_
"Gender = '" & Me.Combo25.Value & "'"
DoCmd.OpenReport Me.Combo8.Value, acViewPreview, ,_
strCriteria, acWindowNormal

I have tried brackets, moving quotation marks around etc.
Thanks in advance!
 
"Comp = """ & Me.Combo1 & """ And Gender = """ & Me.Combo25 & """"
 
Many thanks... with :) :) :D and gratitude! Works great now!
 

Users who are viewing this thread

Back
Top Bottom