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.re cordset!st SName
txtFname.text=adostinfo.re cordset!st Fname
end sub
private sub cmdSave_click()
adostinfo.recordset!stSNam e=txtSname .text
adostinfo.recordset!stFnam e=txtFname .text
adostinfo.recordset.update
adostinfo.recordset.close
end sub
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.re
txtFname.text=adostinfo.re
end sub
private sub cmdSave_click()
adostinfo.recordset!stSNam
adostinfo.recordset!stFnam
adostinfo.recordset.update
adostinfo.recordset.close
end sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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