[AccessD] Comma Decimal separator in UPDATE query

Gustav Brock gustav at cactus.dk
Wed Aug 18 04:07:01 CDT 2004


Hi Ervin

> I have a comma decimal separator and it isn't work in Update query. I want to open the Products form from "Order Details"(subform), modify the price, and get that new price on the subform. How can
> I force the Update query to accept it?
> My query looks like:
>
> DoCmd.RunSQL "Update tblOrderDetail set price=" & NewPrice & " where OrderNo=" & Order & " and ProductNo=" & Product

You have two options. Either create a

  NewPrice100 = Int(NewPrice * 100)

Then adjust the SQL:

  "Update tblOrderDetail set price=" & NewPrice100 & "/100 where OrderNo=" & Order & " and ProductNo=" & Product

Or convert to a string:

  "Update tblOrderDetail set price=" & Str(NewPrice) & " where OrderNo=" & Order & " and ProductNo=" & Product

  /gustav




More information about the AccessD mailing list