how to lock or unlock records

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to lock or unlock the records so that I do not delete or change any
record accidently, please help.
 
Muhammad U. Ameen said:
I want to lock or unlock the records so that I do not delete or change any
record accidently, please help.

Something like this will work:

Private Sub txtUnitCode_AfterUpdate()
Me.txtUnitCode.Locked = True
End Sub

Private Sub Form_Current()
If Len(Me.txtUnitCode & vbNullString) > 0 Then
Me.txtUnitCode.Locked = True
Else
Me.txtUnitCode.Locked = False
End If
End Sub
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access Downloads
http://www.datastrat.com
http://www.mvps.org/access
 
Back
Top