R
Robert
I have a Public code in a standard module that I am
activating with a command button on a form. This code is
intended to switch the Locked and Enabled controls from
True to False and back again. The code works fine with the
exception that the font once changed to red does not
revert back to black when the properties have been set as
False.
Any help is greatly appreciated. The code is as follows
and I thank you in advance...
Public Function ToggleMode()
Const Red As Integer = 255
Dim ctl As Control
For Each ctl In Screen.ActiveForm
If TypeOf ctl Is TextBox Then
With ctl
.Locked = Not .Locked
.Enabled = Not .Enabled
.ForeColor = Red
Forms!frmReqEdit.Caption = "Locked"
End With
End If
Next ctl
End Function
activating with a command button on a form. This code is
intended to switch the Locked and Enabled controls from
True to False and back again. The code works fine with the
exception that the font once changed to red does not
revert back to black when the properties have been set as
False.
Any help is greatly appreciated. The code is as follows
and I thank you in advance...
Public Function ToggleMode()
Const Red As Integer = 255
Dim ctl As Control
For Each ctl In Screen.ActiveForm
If TypeOf ctl Is TextBox Then
With ctl
.Locked = Not .Locked
.Enabled = Not .Enabled
.ForeColor = Red
Forms!frmReqEdit.Caption = "Locked"
End With
End If
Next ctl
End Function