Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update table with SQL error 1

Status
Not open for further replies.

Eprice

Technical User
May 6, 2003
209
US
Hi,
Access XP form and table. I am trying to write this update code and get an error. I am not good with writing sql just going off what I found on google. InUse is a Yes/No field and LSN is the serial number they selected in a combo box.

CurrentDb().Execute "UPDATE [tblHardware] SET AutoNo = '" & strAutoNo & "', InUse = True, Where SerialNo = LSN"

Thanks, Lisa
 
How About
Code:
CurrentDb().Execute "UPDATE [tblHardware] SET AutoNo = '" & strAutoNo & "', InUse = True, Where SerialNo = 'LSN'"
 
You didn't tell us the error or what the data type of AutoNo is. This might work. pwise had an extra , after the True.

Code:
CurrentDb().Execute "UPDATE [tblHardware] SET AutoNo = '" & strAutoNo & "', InUse = True Where SerialNo = 'LSN'"

Duane
Hook'D on Access
MS Access MVP
 
Thanks dhookom, that worked for me.
Lisa
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top