-
txtItemPrice must be a numeric on my form
How will I add this to my database or do calculations on it, ensuring that it is saved as numeric and not as text....
Insert into database....
insert into client values txtItemPrice
or
insert into client values " & txtItemPrice & "
or
???
Calculations....
intTotal = txtItemPrice + txtItemVat
or
intTotal = "txtItemPrice" + "txtItemVat"
or
????
-
When inserting into your database, if you want it to go in as numeric then use INSERT INTO Client VALUES txtItemPrice.
When calculating (I'm presuming you're using integers due to what you've call your variable) then you would use the following ...
Code:
intTotal = CInt(txtItemPrice.text) + CInt(txtItemVat.text)
-
Usually taxes and prices have dollars and cents (or pick you favorite currency and fractinal part, thereof). For that reason, I'd use CCUR instead of CINT
-
I would usually use CCur instead of CCint as well. I only used CInt as turfbults naming of variables indicates that he is using integers. ;)