Microsoft Access - insert into sql statement - Asked By michael brown on 09-Aug-12 01:24 PM

I have the following sql statement in ms access and vb.net. its able to insert the records except the "status".i dont know what might be the problem with the syntax or quotes for "status"



UPDATE [Staff] SET [Surname]='"
& Surname(0) & "',[FirstName]='" & FirstName(0) & "',[Sex]='" & Sex(0) & "',[EmploymentNo]='" & EmploymentNo(0) & "'" & DateOfIssueString1 & ",[Yearofbirth]=" & YearOfBirth(0) & ",[EducationID]=" & EducationID(0) & ",[PositionID]=" & PositionID(0) & " " & CurrentPositionDateString1 & ",[Status]='" & Status(0) & "' WHERE [StaffID]=1 AND [DCID]=" & DCID & " "

        DAL.MyExecuteQuery(Sql)

Robbe Morris replied to michael brown on 09-Aug-12 05:33 PM
If Status is a number field, don't surround the value with single quotes.