Format$ question (1 Viewer)

gguy

Registered User.
Local time
Today, 04:14
Joined
Jun 27, 2002
Messages
104
I need to create an invoice numbering system. The current sequential numbering system is like this LB000102. LB stands for the system. 0001 is the invoice. 02 is year.

The users are very adamnt that the numbering system stay the same.

The problem is with the middle number which needs to be incremented by 1 for each new record. This number drops the leading zeros.

If, for instance, the previous record # was LB001502 then the next number would be LB001602. What I get is LB1602.

In previous threads I have read that Format$ function will allow for leading zeros to be retained but when I go to VB help Format$ does not exist. I need to know if their is a reference that I need to add. The version of Access I am using is office XP.
 

jimbrooking

Registered User.
Local time
Yesterday, 23:14
Joined
Apr 28, 2001
Messages
210
Try

Format$(RecNo,"000000")

for a six-digit return.
 

gguy

Registered User.
Local time
Today, 04:14
Joined
Jun 27, 2002
Messages
104
That got it! Thanks!

Funny I don't seem to have anything in the help on format$ function.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Yesterday, 22:14
Joined
Feb 28, 2001
Messages
27,193
Help files are installed separately from Office itself. By that I mean that the files to make Office work are specified under a different installation heading than the help files that go with office when you perform a custom install. You can choose to do a full install of Office yet install almost no help files. It is also possible that your help files are corrupted or installed in unexpected locations.

Did you install Office yourself? If so, perhaps the first step to the "No Help For Format" problem is to reload the help files using a custom install.

jimbrooking already gave you good advice for the Format problem so I won't bother you with that part of it.
 

gguy

Registered User.
Local time
Today, 04:14
Joined
Jun 27, 2002
Messages
104
Thanks, Doc_man

Now that it is working, I can see that you're likely right and that I need to go back to the install CD for additional help files. I was thinking that I might not have a specific reference loaded. I have vb, Obj lib, OLE, activeX and DOA 3.6 obj lib loaded do you suggest others? GGuy
 

Users who are viewing this thread

Top Bottom