Lock Record

  • Thread starter Thread starter Tim
  • Start date Start date
T

Tim

Hi folks,

I have a form which has the following fields:

ID
Sales
Status

I want to lock the record when the status has "Locked".
Otherwise the records are updatable. Could any one show
me hot to do it?

Thanks in advance.

Tim.
 
Use the Current event procedure of the form to allow/prevent edits, based on
the value in your Status field:

Private Sub Form_Current()
Dim bLock as Boolean

bLock = Nz(Status="Locked", False)
Me.AllowEdits = bLock
Me.AllowDeletions = bLock
End Sub
 
Back
Top