Hi all,
I'm trying to do an insert into query which worked until i added a variable.
The red part used to be a direct reference to the form (me.combo.column(0), which worked), but i have since changed it to a variable which im now getting an error : syntax error in insert into statement
can anyone see what i'm doing wrong??
Thanks,
Spinkung.
I'm trying to do an insert into query which worked until i added a variable.
The red part used to be a direct reference to the form (me.combo.column(0), which worked), but i have since changed it to a variable which im now getting an error : syntax error in insert into statement
Code:
'Create NEW charge transaction
sql = "INSERT INTO TRANSACTIONS (reqNo, Company, charge, hours, quantity, reqDt) " & _
"VALUES ('" & Me.txtJobNo.Value & "', " & _
"'" & Me.comboComp.Column(0) & "', " & _
[COLOR="Red"]"'" & val & "', " & _[/COLOR]
"'" & Me.comboHrs.Column(0) & "', " & _
"" & Me.comboQty.Column(0) & ", " & _
"'" & dt & "')"
DoCmd.SetWarnings False
DoCmd.RunSQL (sql)
can anyone see what i'm doing wrong??
Thanks,
Spinkung.
Last edited: