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

Mixed Number Formatting

Status
Not open for further replies.

acctguy

Technical User
Aug 21, 2007
2
US
I've got a report that has some numbers I would like to format as percentages and others I'd like just formatted as numbers. I found part of my solution in thread thread703-1214770 which tells me how to write the VB portion. But how do I link that script to my report.
 
Custom defined formats may be of help. Looks like:
Format(fieldname,"####") or Format(fieldname,"0.0%"), etc.
Good reference to this in Access help....

Did you hear about the Buddhist who refused Novocain during a root
canal? He wanted to transcend dental medication.
 
Thank you. That info is very helpful. Do you know if there is a way to say if the value is less than 1 to format it as a percentage, otherwise format it as an integer? The custom formats in the help section just let you differentiate among positive, negative, zero, and null.
 
You could use the Immediate If (IIf) function:
IIf(fieldvalue < 1, Format(fieldname,"0.0%"), Format(fieldname,"####")).
Better check the formatting symbology in Access help, though - I'm just doing it from memory
Good Luck!

Did you hear about the Buddhist who refused Novocain during a root
canal? He wanted to transcend dental medication.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top