spinkung
09-11-2007, 02:24 AM
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
'Create NEW charge transaction
sql = "INSERT INTO TRANSACTIONS (reqNo, Company, charge, hours, quantity, reqDt) " & _
"VALUES ('" & Me.txtJobNo.Value & "', " & _
"'" & Me.comboComp.Column(0) & "', " & _
"'" & val & "', " & _
"'" & 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.
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
'Create NEW charge transaction
sql = "INSERT INTO TRANSACTIONS (reqNo, Company, charge, hours, quantity, reqDt) " & _
"VALUES ('" & Me.txtJobNo.Value & "', " & _
"'" & Me.comboComp.Column(0) & "', " & _
"'" & val & "', " & _
"'" & 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.