Friday 15 March 2013

vba - syntax error in update statement run-time error 3144 -



vba - syntax error in update statement run-time error 3144 -

i got syntax error in update statement.run-time error: 3144 utilize next code

currentdb.execute "update product " & _ " set [product name] = '" & me.txtname & "'" & _ ", [cost of product] = " & me.txtcost & "" & _ ", [weight] = " & me.txtweight & "" & _ ", [group] = '" & me.cmbgroup & "'" & _ ", [group id] = '" & me.txtgroupid & "'" & _ ", [ordered] = " & me.txtordered & "" & _ " [roduct name] = " & me.txtname.tag & ""

what can problem? if makes sense, me.txtcost , me.txtweight , me.txtordered number

thanks help!

two problems see:

typo in where [roduct name] (should where [product name]) missing quotes around me.txtname.tag @ end of statement

try instead:

currentdb.execute "update product " & _ " set [product name] = '" & me.txtname & "'" & _ ", [cost of product] = " & me.txtcost & "" & _ ", [weight] = " & me.txtweight & "" & _ ", [group] = '" & me.cmbgroup & "'" & _ ", [group id] = '" & me.txtgroupid & "'" & _ ", [ordered] = " & me.txtordered & "" & _ " [product name] = '" & me.txtname.tag & "'"

vba ms-access

No comments:

Post a Comment