update statement

mfuada

Registered User.
Local time
Today, 15:37
Joined
Feb 4, 2009
Messages
63
Hey guys could anyone tell me whats worng with my sql startement... cause access keep telling me "Syntax Error in UPDATE statement" and i just can't find where my errors are... here's my code:

sql = "UPDATE var_coupon SET face_value_var = " & outs_reoptxtvar.Value & ",coupon_var=" & reop_coup_var.Value & " ,where (([var_coupon].[series_var]) like '*" & strface & "*')"

dbs_var.Execute sql, dbFailOnError


and here's the explanation of my code
var_coupon = table
face_value_var = field from var_coupon
coupon_var = field from var_coupon
series_var = field from var_coupon
outs_reoptxtvar = textbox
reop_coup_var= textbox

Thx
 
For starters, you wouldn't want the comma before "where". If that's not it, add

Debug.Print sql

after that point so you can examine the finished string in the Immediate window. If you don't see the problem there, post the SQL here along with the data types of all the fields.
 
i've added the "debug.print sql" and remove the commas before where
and i have s message error like this "syntax error(comma) in query expression '(0,05)' "
and i also have a message on immediate windows :
UPDATE var_coupon SET face_value_var = (2100000000000),coupon_var = (0,05) where (([var_coupon].[series_var]) like '*VR0017*')

Just to inform you that the sql statement working fine if i just updated the face_value_var, but when i added to update coupon then the problem begins..
and coupon is a percent value in the table i use percent format with 5 decimal and i format the textbox in the form the same way...
 

Users who are viewing this thread

Back
Top Bottom