SQL syntax

  • Thread starter Thread starter Hanksor
  • Start date Start date
H

Hanksor

Ok, Where am I going wrong.

strSQL = "UPDATE tblPointsTest SET tblPointsTest.Training = " & CurAmount &
" WHERE (((tblPointsTest.EmpID)=" & emID & "));"

DoCmd.RunSQL (strSQL)


emID is a string. It runs but asks for emID before completing.

Any help will be appreciated.....
 
Hanksor said:
Ok, Where am I going wrong.

strSQL = "UPDATE tblPointsTest SET tblPointsTest.Training = " &
CurAmount & " WHERE (((tblPointsTest.EmpID)=" & emID & "));"

DoCmd.RunSQL (strSQL)


emID is a string. It runs but asks for emID before completing.

Any help will be appreciated.....

If emID is a string it needs quotes around it.

strSQL = "UPDATE tblPointsTest SET tblPointsTest.Training = " &
CurAmount & " WHERE (((tblPointsTest.EmpID)=' " & emID & " ' ));"

I added spaces around the single quotes above for clarity. You would not
have those in your actual code.
 
Thanks!! I figured it was in plain sight..... Couldn't see the forest for
the trees
 

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


Back
Top