R
Rolf Rosenquist
These lines works when the "newstock" value is an integer.
newstock = instock - orderamount
cmdText = "UPDATE tblProduct SET [instock] = " & newstock & "WHERE
[productID] = " & [order.productID] & ";"
DoCmd.RunSQL cmdText
The fields instock and orderamount in the tables Product and Order are set
to long integer.
Then I came to the insight that I needed to let the user set the orderamount
to a decimal number, so I changed the those fields in both tables from
integer to double, but then I get an syntax error with the UPDATE.
It is possible to set those fields to a decimal value direct in both tables.
It puzzles me that when so done, I can run the command above, when the
result generates an integer to be updated. But not when it will be a decimal
value.
Is there more than the table fields that must be changed to take a decimal
value?
/ Rolf
newstock = instock - orderamount
cmdText = "UPDATE tblProduct SET [instock] = " & newstock & "WHERE
[productID] = " & [order.productID] & ";"
DoCmd.RunSQL cmdText
The fields instock and orderamount in the tables Product and Order are set
to long integer.
Then I came to the insight that I needed to let the user set the orderamount
to a decimal number, so I changed the those fields in both tables from
integer to double, but then I get an syntax error with the UPDATE.
It is possible to set those fields to a decimal value direct in both tables.
It puzzles me that when so done, I can run the command above, when the
result generates an integer to be updated. But not when it will be a decimal
value.
Is there more than the table fields that must be changed to take a decimal
value?
/ Rolf