Hi, i got syntax error in the update statement message when i tried to update all the field in my form. below are my codes:
can anyone tell me where went wrong and where is the syntax error?thank alot.
moCommand.CommandType = adCmdText
moCommand.ActiveConnection = moConnection
sSQL = _
"UPDATE Inventory SET EqpSerialNo = " & txtEqpSerialNo _
& ", BrandName = " & txtBrandName & ", ModelNo = " & txtModelNo _
& ", Specs = " & txtSpecs & ", Notebook = " & chkNotebook.Value _
& ", PurcDate = " & txtPurcDate & ", NetworkType = " & txtNetworkType _
& ", OsType = " & txtOsType & ", Nodename = " & txtNodename _
& ", IpAddress = " & txtIpAddress & ", HubLocation = " & txtHubLocation _
& ", NetworkCableNo = " & txtNetworkCableNo & ", AreaLocated = " & txtAreaLocated _
& ", RespDept = " & txtRespDept & ", RespUser = " & txtRespUser _
& ", Workgroup = " & txtWorkgroup & ", MsOffice = " & chkMsOffice.Value _
& ", AntivirusSoftware = " & txtAntivirusSoftware & ", OtherSoftware = " & txtOtherSoftware _
& ", Opi = " & chkOpi.Value & ", Ecs = " & chkEcs.Value & ", Mcs = " & chkMcs.Value _
& ", Wsp = " & chkWsp.Value & ", SehukConnection = " & chkSehukConnection.Value _
& ", ScannerAttach = " & chkScannerAttach.Value & ", WriteOff = " & chkWriteOff.Value _
& ", Remarks = " & txtRemarks & " WHERE InventoryID = " & sInputDat & " "
moCommand.CommandText = sSQL
Set rsMain = moCommand.Execute
can anyone tell me where went wrong and where is the syntax error?thank alot.
moCommand.CommandType = adCmdText
moCommand.ActiveConnection = moConnection
sSQL = _
"UPDATE Inventory SET EqpSerialNo = " & txtEqpSerialNo _
& ", BrandName = " & txtBrandName & ", ModelNo = " & txtModelNo _
& ", Specs = " & txtSpecs & ", Notebook = " & chkNotebook.Value _
& ", PurcDate = " & txtPurcDate & ", NetworkType = " & txtNetworkType _
& ", OsType = " & txtOsType & ", Nodename = " & txtNodename _
& ", IpAddress = " & txtIpAddress & ", HubLocation = " & txtHubLocation _
& ", NetworkCableNo = " & txtNetworkCableNo & ", AreaLocated = " & txtAreaLocated _
& ", RespDept = " & txtRespDept & ", RespUser = " & txtRespUser _
& ", Workgroup = " & txtWorkgroup & ", MsOffice = " & chkMsOffice.Value _
& ", AntivirusSoftware = " & txtAntivirusSoftware & ", OtherSoftware = " & txtOtherSoftware _
& ", Opi = " & chkOpi.Value & ", Ecs = " & chkEcs.Value & ", Mcs = " & chkMcs.Value _
& ", Wsp = " & chkWsp.Value & ", SehukConnection = " & chkSehukConnection.Value _
& ", ScannerAttach = " & chkScannerAttach.Value & ", WriteOff = " & chkWriteOff.Value _
& ", Remarks = " & txtRemarks & " WHERE InventoryID = " & sInputDat & " "
moCommand.CommandText = sSQL
Set rsMain = moCommand.Execute