Show Id of last record on form

Maggie23

Registered User.
Local time
Today, 00:38
Joined
Jun 18, 2002
Messages
19
I am very new to Access so would appreciate help with this. Each record I have has an unique ID number. When I enter a new record I would like the form to show the last ID used so user knows what ID to use next. As a safety I would like field to not allow any duplication of ID numbers.

I have no clue how to create automatically unique sequential numbering so I thought this might be the simplest approach. Just let user know what the last number was and let him type in the next number.

Thanks for any and all help
 
If you define your primary key field as an autonumber data type, Access will generate a unique id for you.
 
From what I understand autonumbering isn't always the most reliable. I can't have any skipped numbers. Each item logged in must have a unique number in chronological order. So back to my original question I am trying to find out how to have the last record ID show up on the form as reference so the user knows what the next number to use should be.
 
If the sequence is so important to you, you should not be trusting the user to enter a valid value. You can use DMax(...) to return the current maximum value and DMax(....) + 1 to generate the next value. However, this is not all that straightforward in a multi-user environment. Search the archives for advice and code samples.
 

Users who are viewing this thread

Back
Top Bottom