Leading zero for Default Number

L

Lambi000

My users all want their auto-numbers to start with the year....07...and
that's going to last for the next two years. I have a text field that I am
trying to make default to 07 for this year and then another field with an
auto number to increment it.

Why can't I make the default in the text field "07" without it reverting
back to 7. I've tried making up my own mask, but I can't figure out where
I'm supposed to place the zero and the 7.

Guys, there has to be an easier way than reinventing the wheel all the time.

Help!
 
J

John W. Vinson

My users all want their auto-numbers to start with the year....07...and
that's going to last for the next two years.

Then you cannot use Autonumbers. You can't control an autonumber's value, and
it will not start over on January 1, and cannot be made to do so.
I have a text field that I am
trying to make default to 07 for this year and then another field with an
auto number to increment it.

Why can't I make the default in the text field "07" without it reverting
back to 7. I've tried making up my own mask, but I can't figure out where
I'm supposed to place the zero and the 7.

A Number IS A NUMBER. It's not stored with leading zeros; it's actually stored
as a binary string of bits. The numbers 7 and 07 and James Bond's 007 are *all
the exact same number* - stored as 00000000000000000000000000000111 to be
exact.

You'll need to use a Text field, not a number, and write VBA code to insert a
text string (such as Format(Date(), "yy") ) and an incrementing number. I'd
really recommend against having such a field, with two separate pieces of
information in it - a field should be atomic.

If you need a format like 07-00000 through 07-99999, starting over in the new
year, it can be done with some VBA code - but it gets complicated when you
have multiple users. Do a search for "Custom Counter" for examples.

John W. Vinson [MVP]
 

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