Multiuser

User avatar
adam
SilverLounger
Posts: 2195
Joined: 23 Feb 2010, 12:07

Multiuser

Post by adam »

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.
Best Regards,
Adam

User avatar
HansV
Administrator
Posts: 72002
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Multiuser

Post by HansV »

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.
Regards,
Hans

User avatar
adam
SilverLounger
Posts: 2195
Joined: 23 Feb 2010, 12:07

Re: Multiuser

Post by adam »

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?
Best Regards,
Adam

User avatar
HansV
Administrator
Posts: 72002
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Multiuser

Post by HansV »

I don't understand - should user 1 and user 2 edit record #2 at the same time?
Regards,
Hans