6-digit AutoNumber

mattyj1990

Registered User.
Local time
Today, 21:15
Joined
Aug 20, 2007
Messages
38
Hi

Please can you help me

I need to have a Six-Digit autonumber

how do i do this

thanks

Matt Johnson

Microsoft Office Access 2003
 
Last edited:
If you need it to have 6 digit,, and I'm assuming it's meaningful, I'd think that autonumber is probably wrong format for you.

Why do you want six digit?
 
If you need it to have 6 digit,, and I'm assuming it's meaningful, I'd think that autonumber is probably wrong format for you.

Why do you want six digit?

My company requires a 6 digit number (not sure why)

What could i use instead of autonumber
 
Do you need it to be sequential, or something like that? What meaning is it supposed to convey?
 
yes it needs to be sequential because it is a invoice number
 
You'd want to use DMax() function for this.

Search the forum; this kind of thing has been asked before
 
Hi Matty,

I've done this before....if nothing else works for you, try this (it's a pretty easy workaround, but annoying if you ask me)....

Create a blank table with one field = "autonumber". Don't type any data in.

Then create another blank table with one field = "number". Type whatever six digit number in the first row of that column that you want to start with.

Append the record of the "number field" table to the "autonumber field" table. This will start your autonumber table at the number of your choice. Then you will have to append whatever records you have in another table to this "autonumber table".
 
Actually, now that I think about it, this will probably work too for a make-table query...but I've never tried it...
 
Actually, I believe you can seed it at whatever number you like but this still is not going to be the right format for him because he needs sequential numbering and autonumber doesn't do that.
 
Can your 6 digit number have leading zeros like, 000001, or are they insisting that you start numbering at 100000?
 
So start at 1 (one), use a long integer, and format the output.
Code:
Format(me.id, "000000")
 
It works perfectly

Thank You.

-----------------------------------------------------------------------------

My Next problem is how do i reset the autonumber
 
My Next problem is how do i reset the autonumber
Don't use an autonumber. You cannot guarantee continuous numbering with an autonumber. Use DMax() to find the largest number already in use and add 1 to that. Search these forums for more help on this.
 

Users who are viewing this thread

Back
Top Bottom