SQL code wrong-Help.

J

josh

TA,

Try this:
strSQL = "SELECT * FROM cumemployee " _
& " WHERE batch = '" _
& Me!Combo5.Value & "';"

You were missing the semi-colon which is required at the
end of every SQL statement. Try adding this line to help
debug a SQL statement:

debug.print strSQL

If you can't see what's wrong by looking at the SQL, then
copy it into a new query and let access try to fix it.

HTH,
Josh
 
T

TC

josh said:
TA,

Try this:
strSQL = "SELECT * FROM cumemployee " _
& " WHERE batch = '" _
& Me!Combo5.Value & "';"

You were missing the semi-colon which is required at the
end of every SQL statement (snip)


Not true - either in the SQL window of the query designer, or when entering
SQL through code.

TC
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

VBA code issue...Would love expert help. 5
What's Wrong 1
Code Help 3
SQL in VB Code 1
Code chgs table in query 1
Error when running an sql statement 1
Access vs SQL Date Weirdness = Incompatibility? 11
VB Help 12

Top