SQL statement error (1 Viewer)

safeerbinsalih

Registered User.
Local time
Today, 20:14
Joined
Dec 30, 2015
Messages
26
I want update one field in my recordset using UPDATE and WHERE command in SQL. But the following error is showing

strSQL = "UPDATE [tblLogin] SET [Login_password] = '"&Me.txtnewpassword&"' WHERE tblLogin.Login_id = '"&Me.txtLoginid&"'"
db.Execute strSQL, dbFailOnError

It is showing error "Compile error. Expected: End of statement" and highlighting the part "' WHERE tblLogin.Login_id = '"

Login_id is Long data type and Login_password is string

Any help is deeply appreciated
 

Minty

AWF VIP
Local time
Today, 15:44
Joined
Jul 26, 2013
Messages
10,382
Remove the single quotes around txtloginID - it's a number not a string and put spaces between your & 's

WHERE tblLogin.Login_id = " & Me.txtLoginid &" ;"
 

safeerbinsalih

Registered User.
Local time
Today, 20:14
Joined
Dec 30, 2015
Messages
26
Thank you. It worked. Thank you for the info :)
 

Users who are viewing this thread

Top Bottom