A
alekm
Hi,
here is my code event procedure for a check box. I want to allow some users
to change its state and to prevent otheres from change it. Is there any way I
can ban that SendKeys "{ESC}" line? That line is the only way it works not
ending in the loop (you press anything on the form, msgbox pops up again),
but I don't see why??
Private Sub MyCheckBox_BeforeUpdate(Cancel As Integer)
If currentuser <> "RightUser" Then
MsgBox ("You are not right user. You don't touch this check box.")
Cancel = True
SendKeys "{ESC}"
' without last line msgbox pops up again and again when you press
' anything on the form
' only escape key stops it. Why?!
End If
End Sub
Any solutions?
Thanx
alekmil
here is my code event procedure for a check box. I want to allow some users
to change its state and to prevent otheres from change it. Is there any way I
can ban that SendKeys "{ESC}" line? That line is the only way it works not
ending in the loop (you press anything on the form, msgbox pops up again),
but I don't see why??
Private Sub MyCheckBox_BeforeUpdate(Cancel As Integer)
If currentuser <> "RightUser" Then
MsgBox ("You are not right user. You don't touch this check box.")
Cancel = True
SendKeys "{ESC}"
' without last line msgbox pops up again and again when you press
' anything on the form
' only escape key stops it. Why?!
End If
End Sub
Any solutions?
Thanx
alekmil