Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I add a leading Zero in VB

Status
Not open for further replies.

MrMiller

Aerospace
Jan 30, 2004
54
This is probably an easy question for the VB guru....

I would like to set up a combo box to have 001 thru 248 and the numbers 1 thru 99 should include the leading zero(ie: 001, 002, and so on)

What do I need to add to my code below to pull this off? The code below produces (1,2,3, and so on)

For i = 1 To 248
ComboBoxSN.AddItem i '1-248
Next
 
Replies continue below

Recommended for you

You could try the following:

ComboBoxSn.AddItem Format(i, "000")

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
Thanks... that worked!!

I figured it was something so simple.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor