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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top