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.
 
Back
Top