Solved

Padding with 0's

Posted on 1998-09-03
1
123 Views
Last Modified: 2010-04-30
I have a string of a maximum of 4 integers.  If there is one integer (ie. 1), it must show 0001, if it's 10, then it must be 0010, and if it's 9999 then it must be 9999.  Therefore, how do I "pad" with 0's at the beginning of the string?
0
Comment
Question by:mikemonnex
1 Comment
 
LVL 9

Accepted Solution

by:
Dalin earned 50 total points
ID: 1432893


YourString = CStr(YourInteger)

FinalString = Right ("0000" & yourString, 4)
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now