Using MS Access/Drop Down Menu Formating

Advertisement


Question
Hi Scott,

A field in a form (Datasheet view) has a Value List as a Row Source Type (it is a dropdown menu). Is it possible to format this drop down in such a way that it has non-selectable lines? For example:
----------------------------------------
EUROPE (bold or underlined font)
United Kingdom
France
Germany
...
NORTH AMERICA (bold or underlined font)
USA
Canada
Mexico
...
----------------------------------------
In this dropdown a user can only select the country, not the continent.

Constraint: This is only a simplified example. In my case it all MUST BE in one column. I cannot make 2 fields - one for the continent and one for the country.

Thank you

Answer
Yes and no. No you can't make the continent bolded. You also can't make a selection non-selectable. What you CAN do, is use code to prevent the selection. for example:

IF Me.combo = "Europe" Then
   MsgBox "Not a valid selection"
   Cancel = True
End If

Put that in the Before Update event.  

Using MS Access

All Answers


Answers by Expert:


Ask Experts

Volunteer


Scottgem

Expertise

I can answer almost all types of questions relating to Microsoft Access usage and application design. My strengths are database and interface design.

Experience

I've been designing databases for over 25 years working with dBase, FoxPro, Approach and Access.

Organizations
Author of Microsoft Office Access 2007 VBA
Techncial Editor for Special Edition Using Microsoft Access 2007 and Access 2007 Forms, Reports & Queries From Que Publishing

Education/Credentials
Brooklyn College BA

©2016 About.com. All rights reserved.