Welcome to Windows Help!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Auto Number with Letter Prefix

 
   Windows Help (Home) -> Microsoft Access RSS
Next:  Retrieving stored messages from msn.com  
Author Message
Ray

External


Since: Dec 4, 2008
Posts: 3



(Msg. 1) Posted: Sat Aug 29, 2009 5:03 pm
Post subject: Auto Number with Letter Prefix
Archived from groups: microsoft>public>access (more info?)

Unique Serial Numbers:
Here is the issue: I want to give everyone on a list a unique "serial
number" Except that serial number should begin with a prefix, in this case
"TAV 101" So the end product in this column should be a unique number that
appears like this "TAV 101-1" "TAV 101-2" "TAV 101-3" I've looked on the
forums and in help and I don't think I'm wording my question right. Can
anyone help?

 >> Stay informed about: Auto Number with Letter Prefix 
Back to top
Login to vote
John W. Vinson

External


Since: Nov 28, 2008
Posts: 104



(Msg. 2) Posted: Sat Aug 29, 2009 6:31 pm
Post subject: Re: Auto Number with Letter Prefix
Archived from groups: per prev. post (more info?)

On Sat, 29 Aug 2009 17:03:01 -0700, Ray wrote:

>Unique Serial Numbers:
>Here is the issue: I want to give everyone on a list a unique "serial
>number" Except that serial number should begin with a prefix, in this case
>"TAV 101" So the end product in this column should be a unique number that
>appears like this "TAV 101-1" "TAV 101-2" "TAV 101-3" I've looked on the
>forums and in help and I don't think I'm wording my question right. Can
>anyone help?

If every record has the same prefix, then you need not - and should not -
store it in the table at all. You can use a Format property (in a table field,
or as the Format of a form or report textbox) such as

"TAV 1\01-#"

to display the literal characters followed by a number.

However, Autonumbers are not really fit for human consumption. Their ONLY
purpose is to provide a meaningless unique key. They will always have gaps; if
you delete a record it will leave a gap; if you even hit <ESC> while entering
a new record it will leave a gap; if you use an Append query to populate the
table it can leave a huge gap; the numbers can even become random (if you
Replicate). If you want sequential numbers, use a Long Integer field and
manage them yourself, manually or with code - search the groups for "Custom
counter" for examples.

 >> Stay informed about: Auto Number with Letter Prefix 
Back to top
Login to vote
Ray

External


Since: Dec 4, 2008
Posts: 3



(Msg. 3) Posted: Sat Aug 29, 2009 6:31 pm
Post subject: Re: Auto Number with Letter Prefix
Archived from groups: per prev. post (more info?)

Sorry, my brain leaked out of my ears like a runny nose. I should say I've
worked on Excel for one week to be exact and am now "in charge" of 1800 lines
of data.

I have a master sheet of every person who has appeared in a show for five
seasons. Each season has 12 shows. So my serial number wouldn't have the
same TAV 101 prefix. It will go all the way to TAV 509 (for Season 5 show 9)

Do you still recommend using a long integer field? There is going to be a
point where I will have to just type the numbers in manually. Reason is I'm
only temperorary and eventually some other clueless monkey will be running
the database. I was looking for a formula to type in and be done with it but
please let me know if this won't work. Thanks for your advice...

"John W. Vinson" wrote:

> On Sat, 29 Aug 2009 17:03:01 -0700, Ray wrote:
>
> >Unique Serial Numbers:
> >Here is the issue: I want to give everyone on a list a unique "serial
> >number" Except that serial number should begin with a prefix, in this case
> >"TAV 101" So the end product in this column should be a unique number that
> >appears like this "TAV 101-1" "TAV 101-2" "TAV 101-3" I've looked on the
> >forums and in help and I don't think I'm wording my question right. Can
> >anyone help?
>
> If every record has the same prefix, then you need not - and should not -
> store it in the table at all. You can use a Format property (in a table field,
> or as the Format of a form or report textbox) such as
>
> "TAV 1\01-#"
>
> to display the literal characters followed by a number.
>
> However, Autonumbers are not really fit for human consumption. Their ONLY
> purpose is to provide a meaningless unique key. They will always have gaps; if
> you delete a record it will leave a gap; if you even hit <ESC> while entering
> a new record it will leave a gap; if you use an Append query to populate the
> table it can leave a huge gap; the numbers can even become random (if you
> Replicate). If you want sequential numbers, use a Long Integer field and
> manage them yourself, manually or with code - search the groups for "Custom
> counter" for examples.
> --
>
> John W. Vinson [MVP]
>
 >> Stay informed about: Auto Number with Letter Prefix 
Back to top
Login to vote
Larry Linson

External


Since: Dec 9, 2008
Posts: 23



(Msg. 4) Posted: Sat Aug 29, 2009 8:49 pm
Post subject: Re: Auto Number with Letter Prefix
Archived from groups: per prev. post (more info?)

Ray, this newsgroup is not for EXCEL. It is for technical discussion of and
questions and answers about Microsoft ACCESS database software. In the
online interface you used to post here, you need to scroll farther to find
an Excel newsgroup.

John gave you an "Access Answer" but seems you may have been asking an
"Excel Question". They are not the same, and don't work the same.

Please note that John didn't suggest that his solution would work only if
the whole serial number were "prefix"... he was talking about the same
_character_ prefix "TAV" which does seem consistent. How did you plan to
generate the "101" to "509" part of the number? But, for Access, his idea
would work for multiple characters that are alphanumeric.

You should also be aware, in Access, that an Autonumber is strictly intended
for use internal to the database, to guarantee uniqueness, and to join
records in related tables -- it is not guaranteed to be "consecutive",
"monotonically increasing" as you may have assumed, and it is, by
definition, numeric... it is a Long Integer with an autoincrement feature.
But, there are a number of situations in which it may end up being
non-consecutive.

Larry Linson
Microsoft Office Access MVP

"Ray" wrote in message

> Sorry, my brain leaked out of my ears like a runny nose. I should say
> I've
> worked on Excel for one week to be exact and am now "in charge" of 1800
> lines
> of data.
>
> I have a master sheet of every person who has appeared in a show for five
> seasons. Each season has 12 shows. So my serial number wouldn't have the
> same TAV 101 prefix. It will go all the way to TAV 509 (for Season 5 show
> 9)
>
> Do you still recommend using a long integer field? There is going to be a
> point where I will have to just type the numbers in manually. Reason is
> I'm
> only temperorary and eventually some other clueless monkey will be running
> the database. I was looking for a formula to type in and be done with it
> but
> please let me know if this won't work. Thanks for your advice...
>
> "John W. Vinson" wrote:
>
>> On Sat, 29 Aug 2009 17:03:01 -0700, Ray wrote:
>>
>> >Unique Serial Numbers:
>> >Here is the issue: I want to give everyone on a list a unique "serial
>> >number" Except that serial number should begin with a prefix, in this
>> >case
>> >"TAV 101" So the end product in this column should be a unique number
>> >that
>> >appears like this "TAV 101-1" "TAV 101-2" "TAV 101-3" I've looked on the
>> >forums and in help and I don't think I'm wording my question right. Can
>> >anyone help?
>>
>> If every record has the same prefix, then you need not - and should not -
>> store it in the table at all. You can use a Format property (in a table
>> field,
>> or as the Format of a form or report textbox) such as
>>
>> "TAV 1\01-#"
>>
>> to display the literal characters followed by a number.
>>
>> However, Autonumbers are not really fit for human consumption. Their ONLY
>> purpose is to provide a meaningless unique key. They will always have
>> gaps; if
>> you delete a record it will leave a gap; if you even hit <ESC> while
>> entering
>> a new record it will leave a gap; if you use an Append query to populate
>> the
>> table it can leave a huge gap; the numbers can even become random (if you
>> Replicate). If you want sequential numbers, use a Long Integer field and
>> manage them yourself, manually or with code - search the groups for
>> "Custom
>> counter" for examples.
>> --
>>
>> John W. Vinson [MVP]
>>
 >> Stay informed about: Auto Number with Letter Prefix 
Back to top
Login to vote
John W. Vinson

External


Since: Nov 28, 2008
Posts: 104



(Msg. 5) Posted: Sun Aug 30, 2009 2:38 pm
Post subject: Re: Auto Number with Letter Prefix
Archived from groups: per prev. post (more info?)

On Sat, 29 Aug 2009 18:12:01 -0700, Ray wrote:

>Sorry, my brain leaked out of my ears like a runny nose. I should say I've
>worked on Excel for one week to be exact and am now "in charge" of 1800 lines
>of data.

As Larry says, you're asking in the wrong place. This group is for Microsoft
Access, the database application in Office; Excel is a quite different
program. Are you using Excel, or Access? If Excel, please scroll down the list
of subject areas and find a forum for Excel. The volunteers there will be glad
to help.

>I have a master sheet of every person who has appeared in a show for five
>seasons. Each season has 12 shows. So my serial number wouldn't have the
>same TAV 101 prefix. It will go all the way to TAV 509 (for Season 5 show 9)

The Access answer (if that's what you're using) would be to have THREE fields,
not one: Season; Show; SerialNumber. It's not necessary (or a good idea) to
store the text string TAV since it's (apparently) identical in every record in
the table; just use a format to display it.

You can easily concatenate the three fields for display purposes.

>Do you still recommend using a long integer field? There is going to be a
>point where I will have to just type the numbers in manually. Reason is I'm
>only temperorary and eventually some other clueless monkey will be running
>the database. I was looking for a formula to type in and be done with it but
>please let me know if this won't work. Thanks for your advice...

Either with Access or Excel, you'll want to use a program (VBA code, a Module
in Access, or a Macro in Excel - same code, different name) to increment the
number. It's not necessary to enter them manually, and it's not a good idea to
use an Access Autonumber (and, as best as I know, there is no such thing as an
autonumber in Excel).
 >> Stay informed about: Auto Number with Letter Prefix 
Back to top
Login to vote
SuzyQ

External


Since: Jul 28, 2009
Posts: 2



(Msg. 6) Posted: Mon Aug 31, 2009 9:14 am
Post subject: Re: Auto Number with Letter Prefix
Archived from groups: per prev. post (more info?)

Guys, the OP mentioned autonumber, which is not available in Excel (I don't
think so anyway). He may have confused Excel with Access and might be in the
right place afterall.

But it looks like John did answer the question anyway.

"Larry Linson" wrote:

> Ray, this newsgroup is not for EXCEL. It is for technical discussion of and
> questions and answers about Microsoft ACCESS database software. In the
> online interface you used to post here, you need to scroll farther to find
> an Excel newsgroup.
>
> John gave you an "Access Answer" but seems you may have been asking an
> "Excel Question". They are not the same, and don't work the same.
>
> Please note that John didn't suggest that his solution would work only if
> the whole serial number were "prefix"... he was talking about the same
> _character_ prefix "TAV" which does seem consistent. How did you plan to
> generate the "101" to "509" part of the number? But, for Access, his idea
> would work for multiple characters that are alphanumeric.
>
> You should also be aware, in Access, that an Autonumber is strictly intended
> for use internal to the database, to guarantee uniqueness, and to join
> records in related tables -- it is not guaranteed to be "consecutive",
> "monotonically increasing" as you may have assumed, and it is, by
> definition, numeric... it is a Long Integer with an autoincrement feature.
> But, there are a number of situations in which it may end up being
> non-consecutive.
>
> Larry Linson
> Microsoft Office Access MVP
>
> "Ray" wrote in message
>
> > Sorry, my brain leaked out of my ears like a runny nose. I should say
> > I've
> > worked on Excel for one week to be exact and am now "in charge" of 1800
> > lines
> > of data.
> >
> > I have a master sheet of every person who has appeared in a show for five
> > seasons. Each season has 12 shows. So my serial number wouldn't have the
> > same TAV 101 prefix. It will go all the way to TAV 509 (for Season 5 show
> > 9)
> >
> > Do you still recommend using a long integer field? There is going to be a
> > point where I will have to just type the numbers in manually. Reason is
> > I'm
> > only temperorary and eventually some other clueless monkey will be running
> > the database. I was looking for a formula to type in and be done with it
> > but
> > please let me know if this won't work. Thanks for your advice...
> >
> > "John W. Vinson" wrote:
> >
> >> On Sat, 29 Aug 2009 17:03:01 -0700, Ray wrote:
> >>
> >> >Unique Serial Numbers:
> >> >Here is the issue: I want to give everyone on a list a unique "serial
> >> >number" Except that serial number should begin with a prefix, in this
> >> >case
> >> >"TAV 101" So the end product in this column should be a unique number
> >> >that
> >> >appears like this "TAV 101-1" "TAV 101-2" "TAV 101-3" I've looked on the
> >> >forums and in help and I don't think I'm wording my question right. Can
> >> >anyone help?
> >>
> >> If every record has the same prefix, then you need not - and should not -
> >> store it in the table at all. You can use a Format property (in a table
> >> field,
> >> or as the Format of a form or report textbox) such as
> >>
> >> "TAV 1\01-#"
> >>
> >> to display the literal characters followed by a number.
> >>
> >> However, Autonumbers are not really fit for human consumption. Their ONLY
> >> purpose is to provide a meaningless unique key. They will always have
> >> gaps; if
> >> you delete a record it will leave a gap; if you even hit <ESC> while
> >> entering
> >> a new record it will leave a gap; if you use an Append query to populate
> >> the
> >> table it can leave a huge gap; the numbers can even become random (if you
> >> Replicate). If you want sequential numbers, use a Long Integer field and
> >> manage them yourself, manually or with code - search the groups for
> >> "Custom
> >> counter" for examples.
> >> --
> >>
> >> John W. Vinson [MVP]
> >>
>
>
>
>
 >> Stay informed about: Auto Number with Letter Prefix 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Letter Templates in Access - I have been pounding my head all day and unfortunately have come up with nothing but a headache. I'm hoping I can get some help on this... I have several form letters. These letters are sent at various times via Email to my customers. Its easy for me...

Number comparison - Good morning, I have 2 tables that I need to compare customer numbers. One table is for customers that the product was sold to. One table is for product returned by customers. The customer number in the sold to table has 8 mumbers with the last 3 ..

Auto fill - I have two fields from the same table: 1. No side effect (Check box:yes/no) 2. Side Effect Description (drop down box) I want 'Side Effect Description' to default to 'N/A' if 'No side effect is checked'. Below is the code I am using in the got focus..

Number To Month - My field [month] consists of month in number. I've been using this expression to convert number to month name MonthName([Month],True) My problem is i want to display one month after ..say Jan from 12/Dec Hope my explaination is clear

Auto Running a Query - I have a table that is linked to an external file that auto populates when a change is made to the file. Once the table is updated, I apply some business rules to it via a query then append the changes to a Master table. What I would like to have..
   Windows Help (Home) -> Microsoft Access All times are: Pacific Time (US & Canada)
Page 1 of 1

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



[ Contact us | Terms of Service/Privacy Policy ]