View Full Version : Pass control value to SQL criteria


jjw152
03-14-2002, 11:35 AM
I'm trying to pass a text box value on a report to a SQL criteria. This is the code:

sqlstate = "Select * From tblContractorsCodeQuery WHERE (tblContractorsCodeQuery.[Last Name] = '"& last &'" )"

last = the the control on the form. It is a text value. I just can't get the syntax right.

Thanks!

Matthew Snook
03-14-2002, 11:41 AM
It looks like the ' and " may be out of order on the final phrase. You need:

& " ' )" instead of:
& ' " )"

Tell me if it works,

Matt

[This message has been edited by Matthew Snook (edited 03-14-2002).]

jjw152
03-14-2002, 11:53 AM
That was it Matt. Thanks!