Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Record Locking on New Records

Status
Not open for further replies.

danperfect

Programmer
Joined
Sep 6, 2004
Messages
6
Location
GB
I have been viewing this forum, and am confident someone here can help me. I will try to describe my exact problem in as much detail as possible.

I have an Access 97 database, regularly accessed by three users all using Citrix workstations. The main form used is a standard form, whose source is a table. When users update, it is done through the form, not directly in the table. I have record locking set as edited record, but this doesn't seem to affect new records until they have been added to the table. One field is unique to each record and is set to be the primary key. This field just happens to be the record number in almost all cases. Here is the scenario which causes a problem.

User A has received a new claim to input on the system as has user B. Both users click new record. Access gives them both, eg, record 250. They both start adding all their data. They get to the primary key, glance down and both enter 250. No problem. Access allows both users to do this. User A finishes, and closes the form. 2 minutes later User B finishes and attempts to close the form. Error. The primary key is a duplicate. However, letters and coversheets and emails have already been generated using the duplicate number.

How can I make it so that a new record is consolidated into the table as soon as the primary key is generated, so that even if the delay is only seconds before another user creates a new record, they still get the next, next record and thus use a new unique primary key. I have tried with updates, refreshes and saves, but nothing seems to actually update the table until both users close and reopen the form.

My current fix is to automatically send an email to the other users when a number is assigned, so that they will know to manually add one if they create a new record soon after. Not entirely satisfactory.
 
Look FAQ under "michealred" he wrote a FAQ about it


Hope this helps
Hymn
 
Couldn't find that. Sorry if I'm being stupid. How do I search for that? Looked in FAQs and that didn't appear to be there.
 
OOOps
misspelt his name
Go into search search for Michaelred as his handle and search for FAQ's
it is there

Hope this helps
Hymn
 
To properly advise, we need more information regarding the logic behind your primary key.

>Access gives them both, eg, record 250

>They get to the primary key, glance down and both enter 250

Which is it? Access, or the user who creates/enters the PK?

Give us a little more detail on what your primary key is?

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top