Update SQL Syntax

papic1972

Registered User.
Local time
Today, 23:33
Joined
Apr 14, 2004
Messages
122
Hi All,

I have coded a custom function to update the 'JDNo' field in my table tblLocal. The strSQL line looks like this:

strSQL = "UPDATE tblLocal set [JDNo] = " & Forms!frmLoadAllocationBDLoad.Form!lbl1 & " WHERE [LoadLineID] =" & Forms!frmLoadAllocationBDLoad.Form!lstJD001aBD.Column(0) & ";"

I have another field in tblLocal called 'Driver' that i need to update in addition to the 'JDNo', i've tried all sorts of variations of code & scoured the internet for a clue but i don't know what the correct syntax would be.

Can anyone help me?

Thanks.
 
Code:
strSQL = "UPDATE tblLocal set [JDNo] = " & Forms!frmLoadAllocationBDLoad.Form!lbl1 & ", [Driver] = " & Chr(34) & Forms!frmLoadAllocationBDLoad.Form!ControlName & Chr(34) & " WHERE [LoadLineID] =" & Forms!frmLoadAllocationBDLoad.Form!lstJD001aBD.Col umn(0)
You don't need to add the ";" at the end.
 
Wow! Thank you so much Bob, that worked beautifully!!
 

Users who are viewing this thread

Back
Top Bottom