A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Generate my own autonumber?



 
 
Thread Tools Display Modes
  #1  
Old February 4th, 2006, 03:39 PM posted to microsoft.public.access.tablesdbdesign
external usenet poster
 
Posts: n/a
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 10:39 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.