×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Displaying currency field on a form in a text box

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

RE: Displaying currency field on a form in a text box

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

RE: Displaying currency field on a form in a text box

(OP)
Thanks Robert !!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close