SQL syntax

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.....
 
R

Rick Brandt

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.
 
H

Hanksor

Thanks!! I figured it was in plain sight..... Couldn't see the forest for
the trees
 
Top