lock records code

  • Thread starter Thread starter Steel via AccessMonster.com
  • Start date Start date
S

Steel via AccessMonster.com

Hi,

I am currently working on code to lock specific records in a form and came
across a post with the following code that appears to do what I need. This
may be a very simple question but what does bLock refer to in this code?
Also, I interpret the first part of the code as: For the current form when
Year = 2004 then lock all records but what exactly does the second part of
the code do?

Private Sub Form_Current()
Dim bLock As Boolean
If Me.[Year] = 2004 Then
bLock = True
End If
If Me.AllowEdits = bLock Then
Me.AllowEdits = not bLock
Me.AllowDeletions = not bLock
End If
End Sub

Thanks.

Steel
 
Back
Top