How to Add a ID number (not autonumber) Max +1 over a group

Karl K

Registered User.
Local time
Today, 21:05
Joined
Feb 2, 2000
Messages
41
I need to add ID numbers (not autonumber) to a group of records, DMax() + 1. This works fine using a query when there is only one at a time, but records are appended in bunches and I need to make an easy function to add a non-unique identifier on. The user just wants to click a button to add them. Any suggestions?
 
In the past I've used a separate table called tblBatchNum to do this. This table only contains one record.

I set up a procedure to increment up the number in the tblBatchNum file first.

Then, in the update query for your other table, you can update the IDNumber field to the number in the tblBatchNum file.

If you need more detail, let me know.
 
Yes, I guess I need more details. You must run some sort of loop - put the tblBatchNum up by 1, set ID = tblBatchNum, back to loop? Do you have an example code handy? It would be much appreciated.
 

Users who are viewing this thread

Back
Top Bottom