Help!

store a letter and leading zeros in an an access autonumbe..

 
  

Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> General Discussions RSS
Next:  Autonumber  
Author Message
Bruce
External


Since: Jun 27, 2006
Posts: 18



PostPosted: Wed Oct 28, 2009 12:10 pm    Post subject: store a letter and leading zeros in an an access autonumber field
Archived from groups: microsoft>public>access (more info?)

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
Back to top
Gina Whipp
External


Since: Sep 25, 2003
Posts: 426



PostPosted: Wed Oct 28, 2009 3:32 pm    Post subject: Re: store a letter and leading zeros in an an access autonumber field [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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

"Bruce" <Bruce.RemoveThis@discussions.microsoft.com> wrote in message
news:3F7166A7-8FA0-44DF-8CFD-0BA13FFB6A83@microsoft.com...
> 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
Back to top
John W. Vinson
External


Since: Jan 29, 2004
Posts: 2505



PostPosted: Wed Oct 28, 2009 4:10 pm    Post subject: Re: store a letter and leading zeros in an an access autonumber field [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Wed, 28 Oct 2009 12:10:01 -0700, Bruce <Bruce RemoveThis @discussions.microsoft.com>
wrote:

>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...
--

John W. Vinson [MVP]
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> General Discussions All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum