(Access 2007) I have a combobox (Classifier) that displays the selected phrase from the list and colors the Classifier field appropriately when I use this sub-routine, 'On-Change'. (On-Current didn't work for me.)
1. The colorization is not retained, when the form is closed & reopened, only the selected phrase is.
2. The background color of the 'Classifier' field is retained, if the form is not saved or is closed and I advance to open a new form, using the bottom arrows,
3. What vba do I need to include to do that? I'm Asking for help, again, because the due date for completion my project is approaching.
Private Sub Classifier_lbl_Change()
If Me.Classifier_lbl.Text = "CAN use this broker." Then
Me.Classifier_lbl.BackColor = vbGreen
Me.Classifier_lbl.ForeColor = vbBlack
ElseIf Me.Classifier_lbl.Text = "Slow paying broker." Then
Me.Classifier_lbl.BackColor = vbYellow
Me.Classifier_lbl.ForeColor = vbBlack
ElseIf Me.Classifier_lbl.Text = "Do NOT use this broker." Then
Me.Classifier_lbl.BackColor = vbRed
Me.Classifier_lbl.ForeColor = vbBlack
Else
Me.Classifier_lbl.BackColor = vbWhite
Me.Classifier_lbl.ForeColor = vbBlack
End If
'remind the user to save the form when any field is altered or filled
FormHeader.BackColor = vbYellow
End Sub
1. The colorization is not retained, when the form is closed & reopened, only the selected phrase is.
2. The background color of the 'Classifier' field is retained, if the form is not saved or is closed and I advance to open a new form, using the bottom arrows,
3. What vba do I need to include to do that? I'm Asking for help, again, because the due date for completion my project is approaching.
Private Sub Classifier_lbl_Change()
If Me.Classifier_lbl.Text = "CAN use this broker." Then
Me.Classifier_lbl.BackColor = vbGreen
Me.Classifier_lbl.ForeColor = vbBlack
ElseIf Me.Classifier_lbl.Text = "Slow paying broker." Then
Me.Classifier_lbl.BackColor = vbYellow
Me.Classifier_lbl.ForeColor = vbBlack
ElseIf Me.Classifier_lbl.Text = "Do NOT use this broker." Then
Me.Classifier_lbl.BackColor = vbRed
Me.Classifier_lbl.ForeColor = vbBlack
Else
Me.Classifier_lbl.BackColor = vbWhite
Me.Classifier_lbl.ForeColor = vbBlack
End If
'remind the user to save the form when any field is altered or filled
FormHeader.BackColor = vbYellow
End Sub
Last edited: