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!

Help A Novice - Displaying Numeric Data

Status
Not open for further replies.

wilgrant

MIS
May 18, 2006
8
0
0
US
I have an Integer field that I need to display as a fixed position of digits. For example, if the integer value is 135, when I display it in a Message Box, as and example, it shows as 135 (I use the command CStr(fieldname) to do the display) - however what I want to display is a 4 position field with leading zeroes, which in this example would be 0135.

Can any one offer suggestions for this beginning VBA programmer?

Thanks.
 
Have a look at the Format function:
MsgBox Format(fieldname, "0000")

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top