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

What is the difference between the two statements?

Status
Not open for further replies.

longmatch

Programmer
Nov 1, 2001
406
I just a beginner for VBA Programming. I found two statements in ACCESS 2000 VBA HANDBOOK.
(1)strWhere="customerID=forms!orders!customerID"
(2)strWhere="customerID" "" &=forms!orders!customerID &""""
What is the difference?

Thank you

Haijun
 
IN the first, the customerid is a numeric, the second it's a string, which is why the quotes are there. A double-double quote ("") translates to a single quote when enclosed in double quotes.
--Jim
 
Dear Jim:
I got you idea. Could I use the first one to replace the second. Do the two statement complete the same function? What does the second statement mean?. The first one is easy to understand, since it is sql statement.

Thank you

Haijun
 
Haijun,
Both statements are the 'Where' clause of an sql statement or the where clause of a DoCmd.OpenForm/Report statement. You could only use one, and which one depends on the data type of the field Customerid, if it's numeric you must use the first, if text use the second.
--Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top