I have a continuous form in which 3 fields are editable. I want to prevent it from being edit with condition. To do this I used following code
It works well if i remove msgbox but with msgbox it doesnot work. Also when I click on checkbox it show msgbox
PHP:
Dim ctl As Access.Control
For Each ctl In screen.activeform
If ctl.Tag = "edit" Then
If Me.PBY <> Forms!nhome!EID Then
MsgBox "not acceptable"
ctl.Locked = True
Else
ctl.Locked = False
End If
End If
Next ctl
Error_Handler_Exit:
On Error Resume Next
If Not ctl Is Nothing Then Set ctl = Nothing
Exit Sub
It works well if i remove msgbox but with msgbox it doesnot work. Also when I click on checkbox it show msgbox