change the forecolour in my form based on certian text names

Joined
Sep 4, 2006
Messages
8
Reaction score
0
Hi,
I still need help.
I am trying to change the forecolour in my form based on 5 different texts in my [trade]textBox. I am trying to use the select case. But it is not working Maybe some might see what I am doing wrong. Here is the code I have.

Private Sub Trade_AfterUpdate()
If IsNull(Me!Trade) Then
Else
Select Case Me!Trade
Case 1
[Trade] = "Pipefitter"
Me!Trade.ForeColor = vbBlack

Case 2
[Trade] = "BoilerMaker"
Me!Trade.ForeColor = vbRed

Case 3
[Trade] = "IronWorker"
Me!Trade.ForeColor = vbGreen

Case 4
[Trade] = "Scaffolder"
Me!Trade.ForeColor = vbYellow

Case 5
[Trade] = "SheetMetal"
Me!Trade.ForeColor = vbBlue

End Select

End Sub
 

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