Using the function below called from a form I trying to change the backcolor of controls if not empty. The code runs without errors but does nothing to the backcolor. The controls are enabled. Thanks for the help.
Function Shade(strForm As Form)
For Each ctl In strForm.Controls
If TypeOf ctl Is TextBox Or TypeOf ctl Is ComboBox Then
If IsNull(ctl) Or ctl.Value = "0" Or Trim(ctl.Value) = "" Then
Set ctl.BackColor = &H8000000F
Else: ctl.BackColor = &HFFFF&
End If
Else: End If
Next ctl
End Function
Function Shade(strForm As Form)
For Each ctl In strForm.Controls
If TypeOf ctl Is TextBox Or TypeOf ctl Is ComboBox Then
If IsNull(ctl) Or ctl.Value = "0" Or Trim(ctl.Value) = "" Then
Set ctl.BackColor = &H8000000F
Else: ctl.BackColor = &HFFFF&
End If
Else: End If
Next ctl
End Function