store a letter and leading zeros in an an access autonumber field

B

Bruce

Is it possible to create an auto number field that starts with a letter and 5
leading zero's? how would i do this? in access

Thanks
Bruce
 
G

Gina Whipp

Bruce,

By definition autoNUMBER is a number. Numbers contain no zeros or letters.
So the answer to your question as it is is, No. HOWEVER, you can create
your own AutoNumber field using *text* as the Data Type and
DMax("YourAutoNumberField","YourTable")+1 (Yours might be a bit more
complicated as letters will be involved.). But perhaps you should explain
why you are wanting a field that allows 0's and letters.

I am also goign to note, that it sounds like you *care* that AutoNumber keep
it's sequence. If that is true then the typical AutoNumber field is not
what you want as it skips and does not reuse.

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm
 
J

John W. Vinson

Is it possible to create an auto number field that starts with a letter and 5
leading zero's? how would i do this? in access

No.

An Autonumber has one purpose ONLY - to provide a meaningless unique key for a
record. Autonumbers are just numbers; they will ALWAYS have gaps in the
sequence; they cannot be edited. They should be kept "under the hood" and not
exposed to user view.

That said, you can (with a little VBA code) maintain your own "custom counter"
that can be assigned sequentially. Will the letter always by the same, or do
different records have different letters? More details please...
 

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