Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying currency field on a form in a text box

Status
Not open for further replies.

Paul7905

MIS
Jun 29, 2000
205
US
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
 
Hi Paul,
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top