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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Record Lock ALL RECORDS on Continuous Forms???

Status
Not open for further replies.

cariengon

Technical User
Mar 18, 2002
283
US
I have a multiuser database that resides on a network server. Each of the users (5) has a frontend that resides on their hard-drive.

I have been researching and playing with record locking for the last 2 days and I can't seem to find the solution to make this properly work.

I have a form that pulls multiple records for users to view and update. It's a reconciliation that to change the status, at least 2 records need to be chosen so that the net of the chosen records = 0 before the status can be updated. Because the user needs to update more than one record simultaneously, this could be overwritten by another user.

I have tried the OnDirty event on the form, but this seems to be hooked to each individual record - so everytime the user makes a change to one record and moves to the next, they get my message box ("Update Records?"). So this solution did not work either.

1. I'm a bit confused as to where I do the record locking - on the query that feeds the form, or on the form itself?

2. I also am not sure what level? If I select Edited records, does it lock all records that the query or form return? Or If I select ALL records.

In my testing, if I chose ALL records Locked on the form, it seemed to lock both users out of the form when I tried to open it. My queries do not include the Primary Key (as the user doesn't need to view it) - should I be including this too?

Any help that I can get to figure this out is greatly appreciated. I'm on a tight deadline - have to have it fixed in 2 days...
 
I also have the problem and find no solution, so I did this:
I made variables to show in the form and when they left the record I ask the confirmation to Save/Change the record or not.
 
I basically did the same thing by using the OnDirty event, BUT the only problem with this is that I don't want them to have to save on each record - I want them to be able to save on the whole SET of records. I sometimes have 100+ records pull up on a form - what a pain it would be if the user had to answer that everytime they made a change to a record.

Sorry - I'm looking for a more global solution that covers all of the records on the form, not the individual record.

Thanks..
Carie
 
HI

You need to use a Transaction, To do this you declare a beginning of the Transaction (Begin Trans), then when the user has decide dto save all affected records you issue a Commit, or if they cancel the update, you issue a rollback.

Sorry, I know the thoery, but I have not used this with a continuous boud form, so cannot advise on how to actually do it! Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top