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

Format text so "5" is "005" and "10" is "010&

Status
Not open for further replies.

mflancour

MIS
Apr 23, 2002
379
US
Pretty much looking to do what I stated in the tittle. Want to have a text field with 10 charicters that will show as zero's preceding the number but not have more than 10 visible digits.
 
Have you tried using the Format function?

Good Luck
--------------
To get the most from your Tek-Tips experience, please read FAQ181-2886
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
Yes, I just have not found the right way to format it yet though. I tried "0000000000"@ but that dosn't quite work right.
 
I don't know if this will work for you, but in the past I have done this by adding the value to a large number and taking the right most digits - something like this:

If your variable is A and the value is 5, the text box control source could read

=Right(100000 + A,3)

and on a report the value will read 005.

 
To right justify and zero fill a number to a specific number of spaces, you should be able to

FmtVal = Format$(NumVal, "0000000000")

which should work to 10 places.

Good Luck
--------------
To get the most from your Tek-Tips experience, please read FAQ181-2886
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top