help please

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

Guest

I am using allenbrown's code to protect my forms.sometimes while the users
are in hurry the start typing somthing while the form still locked , then
they will notes afer sometime .so I want to do a new coding for my forms like
this:

on key press
if the form is protected then
msgbox"remove protection first"



ok . but i dont want to do this for each and every field individually , how
can i do this by using public code. actully i dont have any info about public
codes .so , i want to use public code and call it for each form. any help on
this.
 
Hi,

Try this on the form's keypress event.
Private Sub Form_KeyPress(KeyAscii As Integer)

If Me.cmdLock.Caption = "&Lock" Then
If MsgBox("Please Unlock", vbOKCancel, "Lock") = vbOK Then
Call LockBoundControls(Me, False) 'see if bLock works here
End If
End If

End Sub
 
Back
Top