Combo Box problems (1 Viewer)

gico1972

Registered User.
Local time
Today, 18:36
Joined
Oct 19, 2008
Messages
25
This is 2 questions rolled into one.

I have a form and one of the controls is a combo box which correctly returns a list of contacts to select once the company name is selected.

If the company selected only has one contact there there would be no need for the user to select the contact. How do i hide the control if the company chosen from the previous tab only has one contact.

Secondly if there are multiple contacts how can i change the colour of the font/bold etc to highlight the chosen contact.

Thanks
 

vbaInet

AWF VIP
Local time
Today, 18:36
Joined
Jan 22, 2010
Messages
26,374
Instead of hiding the control, have you thought of disabling it? All you need to do in the After Update event is:

controlName.Enabled = (Me.combo1.ListCount > 0)
 

vbaInet

AWF VIP
Local time
Today, 18:36
Joined
Jan 22, 2010
Messages
26,374
Missed your second question. You can't normally bolden a row in a listbox or combobox without the use of APIs, which in my honest opinion, isn't worth it.

If you want that level of flexibility then you need to look into using a Listview control.
 

Users who are viewing this thread

Top Bottom