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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic Format of Field

Status
Not open for further replies.

mtompkins

IS-IT--Management
Jan 14, 2003
166
US
I have a database with a price field. This price field's trailing zeros changes depending on the choice of product.

I have created a table of [product][myFormat] to handle this.

I can manipulate the product price on the form without issue (thanks to some help on another thread).

Is there any advice how I can do this when running a report?

For example the table looks like this:

Product A ##.###
Product B ##.#
Product C ####.

When I run the report - which is producing the product transaction price from the ledger - I would like to enforce any trailing zeros dynamically by product.

Any thoughts?

Thanks.
Mark
 
Are you talking about trailing zeroes(0) or are you referring to the number of decimal places to be displayed? You certainly can create a table of formats that can be linked in a query to your inventory table and then update the reports Format property for the price. This can be done in the OnFormat event procedure of the Reports Detail section using the following as an example:
Code:
Me![Price].Format = Me![FormatMask]

The control Me![FormatMask] would be a invisible control in the Detail section. You can shrink it down real small and just stick it in the corner someplace. It won't be seen but will be used to pickup the appropriate mask string.

Post back if you have more questions.

Bob Scriver
Want the best answers? See FAQ181-2886
Nobody believes the official spokesman... but everybody trusts an unidentified source.
Author, Bagdad Bob???

 
Thanks - that was absolutely it -

Sorry it was so basic - it is my first romp with Access.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top