Prevent/Allow multiple users editing new or same records

S

Stimpy707

The answer to my problem is probably somewhere on the forum but I just can't
seem to find it. I apologize in advance if this has been rehashed over and
over.

Multiple users will be using my DB simultaneously. Users will open a form
(CreateNewDoc) to enter data and retrieve a five-digit document number that
acts as unique identifier to issue to and "name" electronic documents
(something similar to an invoice number). I've set it up so that the
five-digit number increments by 1 for each new record.

Example:
#18001 Data...........
#18002 Data...........
#18003 (New)

1) How do I set things up so that if one user opens up the CreateNewDoc form
(thus obtaining the next document number) and another user opens the
CreateNewDoc form that they are issued different numbers?

2) Right now the form is set up to issue the next number immediately.
Should the new doc number only be created once the user has completed all of
the required data entry? I'm beginning to think that it would be better for
a user to input all of the necessary data and then click a button that would
issue the next number.

3) Using question #2 above, suppose the following scenario should happen.
Two or more users open the CreateNewDoc form; UserA and UserB.... Through
some chance two or more users click the "submit" button at the exact same
time. Do I need to account for this with Events or will Access take care of
it and issue separate document numbers for each user?

Thanks in advance for help anyone may have to offer!
 
K

Ken Sheridan

You'll find an example of one way in which this can be handled at:


http://community.netscape.com/n/pfx...yMessages&tsn=1&tid=23839&webtag=ws-msdevapps


The file in question inserts the new number once a user begins to insert
data into a new record, but it could equally well do so via a 'Submit' button.

The principle feature of the demo application, however, is that it allows
the next number at which the sequence will continue to be reset. This is
done by holding the number in an external file in a shared location which is
updated when a user inserts a new record or when the number is reset. Two
users obtaining the same number is prevented by the external file being
opened exclusively and released to another user only after its been updated.

Ken Sheridan
Stafford, England
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top