I'm working with a continuous form and two bound combo boxes: cboCallCategory and cboYouthType. When cboCallCategory <> "Youth", I want the .Locked property for cboYouthType to equal True (Locked) and the font color for the cboYouthType label to change to gray for the current record only.
Currently the changes are happening correctly on the current record, but also executing on the existing records, even where the existing record's cboCallCategory = "Youth".
Should I be adding code in the On Current event proc so the changes happen only on the current record? Your advice is much appreciated.
Here is my code in the After Update event proc for cboCallCategory:
Code:
Private Sub cboCallCategory_AfterUpdate()
If Me.cboCallCategory = "Youth" Then
Me.cboYouthType.Locked = False
Me.lblYouthType.ForeColor = RGB(0, 0, 0) ' black
Else
If Me.cboCallCategory <> "Youth" Then
Me.cboYouthType.Locked = True
Me.lblYouthType.ForeColor = RGB(128, 128, 128) ' gray
End If
End If
End Sub