maximum ID no in a multiuser environment ( MSACCESS)

  • Thread starter Thread starter areejan2000
  • Start date Start date
A

areejan2000

How to get the maximum ID/RegNo with out duplication in a multiuser
environment.

each user should be assigned next avilable ID No with out conflict.

experts...
 
Can't use the AutoNumber?

Create another table to hold the counter for your table. To assign the next
ID:
1. Use the BeforeUpdate event of the form (last possible moment).
2. Lock the counter table exclusively, get the next number.
3. Assign the number to your field.
4. Save the record.
5. Release the lock on the counter table.

Note that each table you do this with will need its own counter table to
avoid concurrency problems.
 
My frontEnd is VB6

"BeforeUpdate" is in access i presume.

{sorry i posted in the wrong forum }
{my fault not giving full details :( , but expecting an answer....}
 
Yes. Form_BeforeUpdate is an event provided in Access.

In VBA, presumably you provide a unique way to save edits (such as the Click
of a button). Use that event.
 
Back
Top