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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WHERE criteria in DOCmd.open form statement

Status
Not open for further replies.

uncleben

IS-IT--Management
Oct 30, 2002
2
GB
Can you use multiple criteria? I'm new to this an cannot get my code to work:

This works fine:

stLinkCriteria = "[Q_ClientNo] = '" & Me![ClientNo] & "'"
DoCmd.openForm stDocName, , , stLinkCriteria

However this does not, and this is what I want to do:

stLinkCriteria = "[Q_ClientNo] = '" & Me![ClientNo] & "'" _
& "and" "[Q_FFNo] = '" & Me![FactFindNo] & "'"

Is it possible to specify two criteria in this way. I suspect I have just got the syntax wrong.

Any help would be greatly appreciated!!!
 
Just a quick guess, (since I haven't tried this myself), but it looks like you just need a couple little changes:

Just add a blank space in front of the word "and" and remove the quotes between the word "and" and "[Q_FFNO]", so that you end up with:

stLinkCriteria = "[Q_ClientNo] = '" & Me![ClientNo] & "'" _
& " and [Q_FFNo] = '" & Me![FactFindNo] & "'"

Good luck.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top