Pass control value to SQL criteria

  • Thread starter Thread starter jjw152
  • Start date Start date
J

jjw152

Guest
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!
 
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).]
 
That was it Matt. Thanks!
 

Users who are viewing this thread

Back
Top Bottom