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

Editing Records

Status
Not open for further replies.

ptrifile

Technical User
Aug 10, 2004
457
0
0
US
I have a button on a form that opens another form that is fed by a query. This form is used to complete some work and there are multiple people that have access to it. If one person opens it they go to the first record, if another person presses the button they also get the first record. Is there any way if one person opens the form and it goes to the first record that when the second person opens the form it goes to the next record or record 2 and not the first record?

hope that made some kind of sense to someone.

Thanks!

Paul
 
So you want to 'lock' the record to the person who first accesses this record, and show to any other person who wants to access this record that it is locked to the first person, right?

What I do is: I have a field in my table called LOCKED_BY_USER where I write who is using that record, I write their UserName.

If nobody is accessing anything, and BSMITH wants to access the record, I check what is in LOCKED_BY_USER field. If it is NULL, I write BSMITH to that field and he ‘owns’ the record.

If SBROWN wants to access this record, I check what is in LOCKED_BY_USER field. This time is BSMITH, so I give the user information “Record is locked by BSMITH” and SBROWN can only look at the information, no updates available.

When either user moves from record to another record, I do the same: check what’s in LOCKED_BY_USER field for that new record and act on it.

Just don’t forget to un-lock any records (Set LOCKED_BY_USER field to NULL Where UserName = ‘YourUser’) when they leave the Form.


Have fun.

---- Andy

A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top