Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sql code brings a type mismatch any suggestions?

Status
Not open for further replies.

jimbo62

Technical User
Oct 19, 2002
43
US
I have a form that takes input from many fields and modifies the underlying query. I have this code for selecting a criteria based on a check box value.

This statement brings back a "Type mismatch" all fields are text ...

If (Me![ChkNODY]) = True And (Me![ChkNODN]) = True And (Me![chkNODX]) = False Then
sWhere = sWhere & " and qryEx_CauseByNOD.[NOD] = '" & "Y" Or "N" & "'"
End If
it runs ok for one value if i take out the or "N"
I want to be able to use an or statement to get 2 values returned.

It has to be simple I must be missing somethingsmall.

Any Suggestions???

Thanks Jim
 
You have to include the argument for each case:

Code:
" AND qryEx_CauseByNOD.[NOD] = 'Y' OR qryEx_CauseByNOD.[NOD] = 'N'"
VBSlammer
redinvader3walking.gif

Unemployed in Houston, Texas
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top