Conditional formatting

M

maceslin

The following code to change the color of the text is working

Private Sub cboClassification_AfterUpdate()
Select Case cboClassification.Value
Case 6
cboClassification.ForeColor = vbRed
Case 7
cboClassification.ForeColor = vbRed
Case 8
cboClassification.ForeColor = vbGreen
Case Else
cboClassification.ForeColor = vbBlack
End Select
End Sub

but

when I move to the next record and open cboClassification all entries
in the drop down are the color from what was last selected. How do I
get cboClassification drop downs to revert to black when I enter into
a new record while at the same time keep old records as slected?

hope this makes sense
Dave
 
M

maceslin

define them as black at the beginning of your code module
--
NTC







- Show quoted text -

inserted
cboClassification.FontColor= vbBlack

before Select Case statement with no change
 
M

maceslin

inserted
cboClassification.FontColor= vbBlack

before Select Case statement with no change- Hide quoted text -

- Show quoted text -

make that ForeColor not FontColor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top