Reputation: 1
Hey everyone I keep getting the following error, Run-Time error '3075': syntax error in string in query expression "0,")'
CurrentDb.Execute "INSERT INTO MobileDeviceUserList(sUser, sDevice, sMobileNumber, sIMEINumber, sSerialNumber, sAccessories, sNewSIMNumber, sComments, sRecorded) " & _
"VALUES (" & Me.cboDevice & ",'" & Me.cboAccessories & ",'" & Me.txtUser & ",'" & Me.txtNumber & ",'" & Me.txtIMEI & ",'" & Me.txtSerial & ",'" & Me.txtNEWSIM & ",'" & Me.recRecorded & ",'" & _
Me.txtComment & "')"
Upvotes: 0
Views: 732
Reputation:
You are misplacing ticks (e.g. '
) in the string construction. Probably through copy and paste errors.
Example:
... & ",'" & Me.cboAccessories & ",'" & Me.txtUser & ",'" & Me.txtNumber & ",'" & ...
... should be something closer to,
... & ",'" & Me.cboAccessories & '",'" & Me.txtUser & '"," & Me.txtNumber & ",'" & ...
I cannot supply a foolproff answer as I do not know what fields are text, numeric, dates or memos. Maybe do a string construction into a string var and debug.print the var to see the result.
Upvotes: 0
Reputation: 43565
?"INSERT INTO MobileDeviceUserList(sUser, sDevice, sMobileNumber, sIMEINumber, sSerialNumber, sAccessories, sNewSIMNumber, sComments, sRecorded) " & _
"VALUES (" & Me.cboDevice & ",'" & Me.cboAccessories & ",'" & Me.txtUser & ",'" & Me.txtNumber & ",'" & Me.txtIMEI & ",'" & Me.txtSerial & ",'" & Me.txtNEWSIM & ",'" & Me.recRecorded & ",'" & _
Me.txtComment & "')"
Upvotes: 1