Hi Guys,
I'm trying to perform an UPDATE statement from a module with DoCmd.RunSQL, but the code doesn't work, displaying error 3144, "syntax error in UPDATE statement". I've tried many solutions, but actually can't find the error.
here is my code:
Sub EditRecord()
Dim SQL As String
Dim Supp As Integer
Dim Fname As String
Dim Lname As String
Dim Tel As String
Dim Mob As String
Dim Mai As String
Dim Note As String
Dim IDCon As Integer
Supp = Forms!Add_Contact.Cbo_ID_SUPPLIER
Fname = Forms!Add_Contact.First_Name
Lname = Forms!Add_Contact.Last_Name
Tel = Forms!Add_Contact.Telephone
Mob = Forms!Add_Contact.Mobile
Mai = Forms!Add_Contact.Mail
Note = Forms!Add_Contact.Notes
IDCon = Forms!Contact.ID_CONTACT
SQL = "UPDATE Contacts" & _
"SET Contacts.ID_SUPPLIER = " & Supp & ", Contacts.First_Name = '" & Fname & "', Contacts.Last_Name = '" & Lname & "', " & _
"Contacts.Telephone = '" & Tel & "', Contacts.Mobile = '" & Mob & "', Contacts.Mail = '" & Mai & "', Contacts.Notes = '" & Note & "' " & _
"WHERE Contacts.ID_CONTACT = " & IDCon & "; "
DoCmd.RunSQL SQL
End Sub
Could someone help me please?
Pietro