Combo Box Control

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I currently have a combo box that pulls information from one of my master
tables. The combo box pulls citys but it also allows the user to pull the
state. Ex.
-----
ARIZONA
CALIFORNIA
PHX
TUS
SFO
SAN
etc...

Is there a way to BOLD or Change the font/color of certain entries in my
combo box such as the States?
 
As Doug says, the standard Access combobox won't do this. In theory you
could use an ActiveX "owner draw" combobox control. Owner draw means you
have full control over how each item in the list is formatted. But it
would be quite a lot of work, and would complicate the process of
packaging and distributing your application.

For a simple alternative, how about using a couple of spaces to indent
the cities but not the states? For instance, if your table has a
Location field containing the state name or city abbreviation, and an
IsState yes/no field distinguishing cities from states, you'd use
something like

SELECT
Location,
IIF([IsState],[Location]," "&[Location]") AS ListItem
FROM tblLocations
ORDER BY Location
;

in a two-column combobox with the ColumnWidth property set to "0" and
the BoundColumn to 1.
 
Back
Top