A
Adrian
Hello Group!
I have this code in a TOGGLE BUTTON to lock all Controls on a Form and SubForm (the same one, avoids the blockade of a command button and a textBox in order to make searches in the MainForm)
Private Sub Alternar163_Click()
Dim ctl As Control
For Each ctl In Me.Controls
If (TypeOf ctl Is TextBox) Or (TypeOf ctl Is ComboBox) Or (TypeOf ctl Is CheckBox) Or (TypeOf ctl Is SubForm) Then
If ctl.Locked = True Then
ctl.Locked = False
Else
ctl.Locked = True
End If
End If
Next
If Me.Alternar163.Caption = "Form bloqueado" Then
Me.Alternar163.Caption = "Form desbloqueado"
Else
Me.Alternar163.Caption = "Form bloqueado"
End If
Err.Clear
BUSCARNroIPP.TabStop = False
TXTBUSCAR.Locked = False
End Sub
......The Toggle Button , when loading form, remains Locked and when I need to change a registry I press it and it is unblocked.
What I need is that when happening to another registry, it becomes to activate the button.
Thanks a lot!
I have this code in a TOGGLE BUTTON to lock all Controls on a Form and SubForm (the same one, avoids the blockade of a command button and a textBox in order to make searches in the MainForm)
Private Sub Alternar163_Click()
Dim ctl As Control
For Each ctl In Me.Controls
If (TypeOf ctl Is TextBox) Or (TypeOf ctl Is ComboBox) Or (TypeOf ctl Is CheckBox) Or (TypeOf ctl Is SubForm) Then
If ctl.Locked = True Then
ctl.Locked = False
Else
ctl.Locked = True
End If
End If
Next
If Me.Alternar163.Caption = "Form bloqueado" Then
Me.Alternar163.Caption = "Form desbloqueado"
Else
Me.Alternar163.Caption = "Form bloqueado"
End If
Err.Clear
BUSCARNroIPP.TabStop = False
TXTBUSCAR.Locked = False
End Sub
......The Toggle Button , when loading form, remains Locked and when I need to change a registry I press it and it is unblocked.
What I need is that when happening to another registry, it becomes to activate the button.
Thanks a lot!