Link to home
Start Free TrialLog in
Avatar of pedong
pedong

asked on

Know if Record is lock

I want to know if a record is used by other user, if it is then i want to disabled the save command button. I do this so that the user can only see the content but cannot save it if they have done some correction. The problem is that still other user can do some changes in the database since this code cannot determine that the record is used by others.
I dont know if this is the right way to do this but my code is:

if Adostinfo.LockType = adLockPessimistic then
        cmdSave.enable=false
else
        cmdSave.enable=true
end if

txtSName.text=adostinfo.recordset!stSName
txtFname.text=adostinfo.recordset!stFname

end sub

private sub cmdSave_click()
     adostinfo.recordset!stSName=txtSname.text
     adostinfo.recordset!stFname=txtFname.text
     adostinfo.recordset.update
     adostinfo.recordset.close
end sub

ASKER CERTIFIED SOLUTION
Avatar of David Lee
David Lee
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
No comment has been added to this question in more than 21 days, so it is now classified as abandoned..
I will leave the following recommendation for this question in the Cleanup topic area:
Accept BlueDevilFan's comment as an answer

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

DarkoLord
EE Cleanup Volunteer