In a form I have calculated field called Tax; Tax = (txtQuantity*txtPrice). On change event on txtQuantity (type Number) and txtPrice (type Currency) fields I’m updating column Tax in tblAccouns table using VBA:
DoCmd.RunSQL "Update TblAccounts SET Tax = " & Me.Tax & " Where Key = " & Me.Key
The problem is only when the value of Tax is a decimal number. Then the error is: “Run-time error 2498 Syntax error in update statement”.
I don’t know what is the problem. Can somebody help me?
Thanks in advance
DoCmd.RunSQL "Update TblAccounts SET Tax = " & Me.Tax & " Where Key = " & Me.Key
The problem is only when the value of Tax is a decimal number. Then the error is: “Run-time error 2498 Syntax error in update statement”.
I don’t know what is the problem. Can somebody help me?
Thanks in advance