Backcolor Toggle

trog

New member
Local time
Today, 04:18
Joined
Jul 17, 2012
Messages
4
I am using some simple code (below) to toggle the back ground color of text boxes.
Case "EPA Stations"
With Forms!NXT_locator!E1
.BackColor = (IIf(.BackColor = vbYellow, vbGreen, vbYellow))
With Forms!NXT_locator!E2
.BackColor = (IIf(.BackColor = vbYellow, vbGreen, vbYellow))
With Forms!NXT_locator!E3
.BackColor = (IIf(.BackColor = vbYellow, vbGreen, vbYellow))
End With
End With
End With

This works great if you only have a few, But they all toggle at once. What I need is to select an item from a combo box, and have only the selection toggle. I need to use a variable to represent the item selected and change only that item. Any suggestions?
 
In plain English what are you trying to do?
What do Forms!NXT_locator!E1, Forms!NXT_locator!E2... represent?

Can you show all of the code?
 
I've uploaded a screen shot(I think). When you click on EPA Stations, 3 text boxes named E1, E2, and E3 toggle between yellow and green using the Timer Event. What I would like to do is use a Combo Box and select an individual item and have it toggle background colors.
 
should have attachment
 

Attachments

  • screen shot.JPG
    screen shot.JPG
    82.4 KB · Views: 95

Users who are viewing this thread

Back
Top Bottom