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

Format numbers in a string

Status
Not open for further replies.

fredpeters555

Technical User
Jul 16, 2003
19
CA
I have a data string inside a control that contains text as well as field data. I would like to format currency, % and dates within the string. It is as follows: =Sum([Expr1]) & " or " & ([text5]/[text6]) & " % " & "of Inventory has not moved since " & [dMoveDate] . Expr1 is currency, ([text5]/[text6])is % and [dMoveDate] obviously is date.
TIA!
Fred
 
look up the FORMAT function in help:

=format(Sum(Expr1),"Currency") & " or " & format(([text5]/[text6]),"0.0%") & " of Inventory has not moved since " & format(dmovedate,"m/d/yy")

totally off the topic: it might be better if you rename your fields. for example, ChargeAmount is more descriptive than Expr1....just a thought....
 
Thanks for the help. It worked very well for me. I did search out help on the FORMAT before I posted but it muast have been just in Access as opposed to VBA. Thanks for the tip on the Expr1 rename. Sloppy practice I've had since starting.

Fred
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top