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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

change text color depending on control

Status
Not open for further replies.

drrocket5292

Technical User
Sep 6, 2005
73
US
i have a form that updates a customer account. it has four list boxes and an update button. what i would like to do is after you click a customer, account, and then two types of account specifications and click update, i would like for the account font in the account listbox that you updated to turn red. is there an easy way to do this? thanks for the help.
 
dr rocket,

check at the .ForeColor property of the listbox

"In three words I can sum up everything I've learned about life: it goes on."
- Robert Frost 1874-1963
 
If you are talking about textbox/combobox then look for conditional formatting (supported by access 2000 or higher).
There is no option to turn a different color for a row of a listbox in access

________________________________________________________
Zameer Abdulla
Help to find Missing people
You may be the boss' pet; but you are still an animal
 
ZmrAbdulla

Actually there is.
.Forecolor does changes the color of the listbox, but it does so for all rows.

However, you can use the ListViewCtrl Object to add a listbox where you can have different colors in each row.


Like:
Dim ListView As Object
Dim itmx As ListItem

Set ListView = Forms!Menu.List1
ListView1.ListItems.Clear
ListView.ListItems.Add( , ,"Item1)
itmx.SubItems(1) "..."
itmx.ForeColor = vbRed
itmx.Bold = True

But check out the help for it, not really complete and self-explanatory what i put above. It is a bit tricky.



"In three words I can sum up everything I've learned about life: it goes on."
- Robert Frost 1874-1963
 
DaOtH,
May be my english was not clear.. I meant there is no option to turn a single row of the listbox to a different color.

I know you can use ListView with conditional formatting
Here is MY FAQ on this
ListView & Microsoft Access - Part 3 - (Conditional Formatting) faq702-6027
it was part 3 of the series
ListView & Microsoft Access - Part 1 - (Load Data) faq702-6025
ListView & Microsoft Access - Part 2 (Master-Sub & Column total) faq702-6026

Regards

________________________________________________________
Zameer Abdulla
Help to find Missing people
You may be the boss' pet; but you are still an animal
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top