Hi Guys,
So i was able to come up with the following code to set the back color of all command button on a form except one. And it works.
Now my problem is, i want the exception to hit more than one button command. I actually have 5 commands which i don't want to be affected by the change in the back color. But i have no clue as to how to go about it.
Any help???
Code:
Const BtBackColor As Long = 3355443
Dim ctl As Control
If IsNull(Me.SomeTxtField) Then For Each ctl In Me.Controls
If ctl.ControlType = acCommandButton Then
If ctl.Name <> "Cmd_Button1_ToBeExcluded" Then 'I need to add 4 more command buttons here
With ctl
.BackColor = BtBackColor
.ForeColor = vbWhite
End With
End If
End If
Next ctl
End If