If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Generate my own autonumber?
It can be done. Instead of an autonumber, just use a number field as your
primary key. In the Before Insert event of the input form, do a DMax of the PK number field and add one to it. Something like this will work as long as there aren't too many people entering records into the database at once. There's a very slight possibility that two people could try to insert the same number at once. As the field is a PK, one of them will get an error. -- Jerry Whittle Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder. "Alec M1BNK" wrote: How is the question. i need to create an auto incrementing number for each successive record, but one which will maintain the sequence infallibly with no gaps. Before anyone asks, here's the why. Our accounts manager is unhappy becase the autoinvoicing system I have implemented inside an access database, uses the autonumber record ID from the table of invoice data to generate an invoice reference number. As we all know, any database using autonumber aquires gaps, missing numbers from the sequence, more users = more mistakes = more gaps. Apparently the auditors might think there is something fishy going on if the invoice numbers are not in perfect sequence. Alec |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
DB Design and Relationship Questions | tjr | Database Design | 7 | December 26th, 2006 07:03 PM |
Is Access even the right idea? | BMB | New Users | 19 | November 21st, 2005 08:01 PM |
do all primary keys use autonumber | k | Database Design | 11 | November 20th, 2005 01:23 AM |
Access 2000, autonumber fields | Zyberg74 | General Discussion | 3 | November 17th, 2004 04:24 PM |
Autonumber | Ally H. | General Discussion | 7 | August 27th, 2004 04:51 PM |