Fill in leading 0's

L

Lee T.

My users want to have the system create part of the id.
The way the ID is set up is year (now 04) a - and then a
six digit number but if early in the year the 6 digit
number has leading zeros.

So if the ID number is: 04-001234

I would like it to auto put in the 04- and then let the
users type in the 1234 and have the system put in the
leading zeros.

Any ideas would be very much appreciated.

tia

Lee T.
 
V

Van T. Dinh

Store then as 2 *separate* Fields in your Table, one for the year and one
for the Seq. number.

When you want to display the ID number in the required format, simply
"calculate" / concatenate them like:

Format(IDYear, "yy") & "-" & Format(IDSeq, "000000")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top