I'm using Access 2000, and in both the front-end and back-end, I have it set to open using record-level locking, with Edited Record as the default.
I am doing a library-type database, and I'm having a problem with my form where the users check out the books (frmCheckOut). This form has its RecordLocks property set to Edited Record. Sometimes, instead of locking only the currently edited record, it will lock a second record as well. It only happens if I follow a series of steps, so please bear with me.
I have a transactions table and a books table (tblTrans and tblBooks) that have a many-to-many relationship (using tblTransBooks). In frmCheckOut, I use record locking to secure the current transaction record. The user enters the transaction information, goes to a subform to select books (which I lock by setting a dummy field), and then completes the transaction (which actually updates the Book records). After completing the transaction, the form is still open to allow the user to review the transaction information and print a receipt.
The only way I have been able to reproduce this error is:
1) User 1 begins a transaction (Transaction #1) and selects a book (Book #1) as part of the transaction.
2) User 2 begins a transaction (Transaction #2) and attempts to make Book #1 part of the transaction. User 2 receives an error message.
3) User 1 completes Transaction #1, but does not close the form or move to another transaction.
4) User 2 attempts to add Book #1 to the transaction again, but receives an error because it is alredy checked out.
What happens now is that User1 now has Transaction #1 and Transaction #2 locked in tblTrans (even if they are not consecutive records). This prevents User 2 from completing Transaction #2.
This does not happen unless I get both error conditions. If User #1 closes the form, the lock disappears. I can see no reason why Access would choose to lock Transaction #2 for User #1. Please help (and thank you for your patience with this lengthy explanation).
Sleep is for people with no caffeine.
I am doing a library-type database, and I'm having a problem with my form where the users check out the books (frmCheckOut). This form has its RecordLocks property set to Edited Record. Sometimes, instead of locking only the currently edited record, it will lock a second record as well. It only happens if I follow a series of steps, so please bear with me.
I have a transactions table and a books table (tblTrans and tblBooks) that have a many-to-many relationship (using tblTransBooks). In frmCheckOut, I use record locking to secure the current transaction record. The user enters the transaction information, goes to a subform to select books (which I lock by setting a dummy field), and then completes the transaction (which actually updates the Book records). After completing the transaction, the form is still open to allow the user to review the transaction information and print a receipt.
The only way I have been able to reproduce this error is:
1) User 1 begins a transaction (Transaction #1) and selects a book (Book #1) as part of the transaction.
2) User 2 begins a transaction (Transaction #2) and attempts to make Book #1 part of the transaction. User 2 receives an error message.
3) User 1 completes Transaction #1, but does not close the form or move to another transaction.
4) User 2 attempts to add Book #1 to the transaction again, but receives an error because it is alredy checked out.
What happens now is that User1 now has Transaction #1 and Transaction #2 locked in tblTrans (even if they are not consecutive records). This prevents User 2 from completing Transaction #2.
This does not happen unless I get both error conditions. If User #1 closes the form, the lock disappears. I can see no reason why Access would choose to lock Transaction #2 for User #1. Please help (and thank you for your patience with this lengthy explanation).
![[morning] [morning] [morning]](/data/assets/smilies/morning.gif)