Hi anyone,
Let's say I have an access back end and an excel front end multi user form with a serial number which changes each time I add data to the database.
For an example;
In multi user environment two users from two PC's opened the user form simultaneously where both the forms had the same serial number 100 on form load.
How could a code be generated when one user saves the form with the serial number 100, the next available number on both the forms become 101.
I hope I've made my question clear.
Any help on this would be kindly appreciated.
Multiuser
-
- Administrator
- Posts: 78393
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Multiuser
It'd be best to compute the serial number when the record is saved instead of when the form is loaded.
Use a SQL string to retrieve the maximum serial number stored in the table, add 1 and use that when saving the new record.
Use a SQL string to retrieve the maximum serial number stored in the table, add 1 and use that when saving the new record.
Best wishes,
Hans
Hans
-
- SilverLounger
- Posts: 2347
- Joined: 23 Feb 2010, 12:07
Re: Multiuser
Let's say user 1 saves record 1 and the next available record for user 1 is record 2 on his userform.
But how will this record 2 be available in user 2 form when both forms are opened on two PCs by two users at the same time?
But how will this record 2 be available in user 2 form when both forms are opened on two PCs by two users at the same time?
Best Regards,
Adam
Adam
-
- Administrator
- Posts: 78393
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Multiuser
I don't understand - should user 1 and user 2 edit record #2 at the same time?
Best wishes,
Hans
Hans