Creating a Serial Number from an Autonumber 
Author Message
 Creating a Serial Number from an Autonumber

Here's what I'm attempting to do.  I have a set of samples
in a table that is used as a queue.  One of these fields is
an autonumber.  I'd like to take that autonumber and put it
in a format to achieve incremental serial numbers (i.e.
A00001, A00002, A00003, etc.).  This in itself is pretty
easy to do.  However, when the autonumber becomes 2 digits,
the number of 0s decreases (i.e. A00010, A00011, etc.), and
so on and so forth when the autonumber reaches 3 digits, 4,
etc.  How would I maintain the serial number length while
allowing the autonumber to be appended to the end?  TIA.

--
David Needham

Assistant Scientist
Gene Expression Profiling
Paradigm Genetics, Inc.
ph. 425-3018 or 544-5578 (x3018)

http://www.*-*-*.com/



Mon, 21 Jul 2003 22:02:49 GMT  
 Creating a Serial Number from an Autonumber
Use the format function on the number.

DisplayNumber = "A" & Format(AutoFieldNumber,"00000")

Quote:

> Here's what I'm attempting to do.  I have a set of samples
> in a table that is used as a queue.  One of these fields is
> an autonumber.  I'd like to take that autonumber and put it
> in a format to achieve incremental serial numbers (i.e.
> A00001, A00002, A00003, etc.).  This in itself is pretty
> easy to do.  However, when the autonumber becomes 2 digits,
> the number of 0s decreases (i.e. A00010, A00011, etc.), and
> so on and so forth when the autonumber reaches 3 digits, 4,
> etc.  How would I maintain the serial number length while
> allowing the autonumber to be appended to the end?  TIA.

> --
> David Needham

> Assistant Scientist
> Gene Expression Profiling
> Paradigm Genetics, Inc.
> ph. 425-3018 or 544-5578 (x3018)

> http://www.paradigmgenetics.com/



Tue, 22 Jul 2003 00:10:50 GMT  
 Creating a Serial Number from an Autonumber

Quote:

>Here's what I'm attempting to do.  I have a set of samples
>in a table that is used as a queue.  One of these fields is
>an autonumber.  I'd like to take that autonumber and put it
>in a format to achieve incremental serial numbers (i.e.
>A00001, A00002, A00003, etc.).  This in itself is pretty
>easy to do.  

But what happens when a user starts to enter a record and then presses
Escape to back out?  The autonumber value will be missing.  Or is this
not relevant?

Tony
----
Tony Toews, Microsoft Access MVP
   Please respond only in the newsgroups so that others can
read the entire thread of messages.
   Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm



Thu, 24 Jul 2003 07:28:38 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Network card serial number or Bios Serial Number

2. VB.net: Creating an application that requires a serial number

3. creating serial numbers

4. VB controls & autonumber/serial values

5. Making my own Control Number similar to an autonumber

6. autonumber to start at a different number

7. AutoNumber Random Number

8. Setting AutoNumber to any Number/digits

9. Changing ID Number to autonumber

10. Programming Incremental number that function like AutoNumber but isn't

11. Q: Autonumber calculation, need that number before update!

12. Using number other than AutoNumber

 

 
Powered by phpBB® Forum Software