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

WHERE?!?!!?!?!?!? In Access 97

Status
Not open for further replies.

indianadave

Technical User
Mar 27, 2005
3
US
How can I go about setting two criteria in the WHERE portion of the following command:

DoCmd.OpenForm "frmSiteInformation", acNormal, , Me!Code = strGetCustomerCode

I want to add the following criteria to the line:

Me!Site Code = strGetSiteCode

Help!

 
Have you tried:

Me!Code = strGetCustomerCode AND Me!Site = strGetSiteCode
Tom Budlong
TomBudlong@Bigfoot.com

 
Don't forget the proper syntax, first you don't need the "ME" in the WHERE clause of an OpenForm method unless you are referring to a field on the current form.

If the two functions return strings, then use the following (which I assume from the str prefix):

"Code = '" & strGetCustomerCode & "' AND Site = '" & strGetSiteCode & "'"

If they were to return numbers, then use the following:

"Code = " & strGetCustomerCode & " AND Site = " & strGetSiteCode Jim Lunde
compugeeks@hotmail.com
Custom Application Development
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top