Displaying currency field on a form in a text box
Displaying currency field on a form in a text box
(OP)
Have a form with a text box on it. the format of the text box is set to Currency, 2 decimal places.
I am propagating this field from a Global defined as Price$.
I propagated this Global from Vba code via a read on a table (Price$ = rst.unitprice)
in the table, the field is defined as currency with 2 decimal places.
when i look at the table in datasheet view, the data appears as "$185.00"
but, in my text box on the form, it appears as "185"
the decimal places are missing as well as the dollar sign.
I looked at the data (stepping through the code using the F8 key and in the Price = rst.unitprice statement, the value that appears in the rst.unitprice is "185" !
is there a way to force the data in the text bos on the form to appear as it does in the table in datasheet view ? i.e. as "$185.00" instead of "185" ?
thanks !
Paul
I am propagating this field from a Global defined as Price$.
I propagated this Global from Vba code via a read on a table (Price$ = rst.unitprice)
in the table, the field is defined as currency with 2 decimal places.
when i look at the table in datasheet view, the data appears as "$185.00"
but, in my text box on the form, it appears as "185"
the decimal places are missing as well as the dollar sign.
I looked at the data (stepping through the code using the F8 key and in the Price = rst.unitprice statement, the value that appears in the rst.unitprice is "185" !
is there a way to force the data in the text bos on the form to appear as it does in the table in datasheet view ? i.e. as "$185.00" instead of "185" ?
thanks !
Paul
RE: Displaying currency field on a form in a text box
can you not set the text box format to currency?
or if that doesn't work set a custom format specification
for the field such as
$#,##0.00;"-$"#,##0.00
it's because you are getting a value from a record field the value is simply the value not formated as anything inparticular just a value so for the text box you also need to format the value as currency, access doesn't always allow the currency (or any other built in format) so you may have to provide you own.
HTH
Robert Dwyer
rdwyer@orion-online.com.au
RE: Displaying currency field on a form in a text box