Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I make a combo box turns a field name to different color?

Status
Not open for further replies.

lebanoncedars

Programmer
Jul 17, 2002
43
CA
Hi there,
If I have a combo box with 3 options in it on my form.

Anyone knows How can I make a combo box turns specific field name on my form to a different name and at the same time change the field color to a different color?

Example:
to be dispatched = red color
Dispatched = yellow color
Cleared = cyan color
Invoiced = dark blue color

What are the steps should be done?
DETAILS PLEASE..

Thanks
Lebanoncedars
 
Hope this helps, sorry not much detail, could sit down for a hour and figure it out fully but this is basicly how I would do it. sorry but it not proper code

on change event

dim comboname as txt,
dim 1stcolour as long, 2ndcolour aslong...

(this is the bit I don't know its the RGB function)

1stcolour = RGB(255, 0, 0) (red)
2ndcolour = RGB(0, 0, 0) (black)

select case comboname

Case "to be dispatched"
Me!comboname.ForeColor = 1stcolour
Case "Dispatched"
Me!comboname.ForeColor = 2ndcolour
case " ......

End Select

end sub


for more help use access help and search for "Select Case statement" and "forecolor property"

 
Hello mikih,
Thank you anyway, I will try it out and let U know.

Tnx
Lebanoncedars
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top