Access 2010: Using Option Groups in Forms

An option group can be helpful in making Access client forms more user friendly when entering numeric values or yes/no fields. Notice the drop-down list shown here with numeric values that represent various types of customers:

Drop-down before creating option group

Option groups may apply to toggle buttons, checkboxes, or radio buttons and work well if you don’t have a lot of options from which to choose.  In this example, a lookup was previously created to look up the CustType from the CustomerTypes table. Notice that the text values are sorted in ascending order. We will create a mutually exclusive radio button, which will allow you to select only one value at a time for the customer type as you enter new customers into the Customers table.

In Design view, first remove the existing CustType controls. Then select the Option Group control located in the Options group: Option group control

Make sure the Use Control Wizards command is enabled in the Controls group, and a Wizard will begin taking you through the steps in entering the appropriate labels and numeric values. You will want to correctly match up each numeric value with the appropriate label.

Note: Remember that Option groups can only be bound to numeric or Yes/No fields. When storing values in Yes/No fields, the Yes value should be set to -1 and the No value should be set to 0.

As you progress through the Wizard, follow these steps:

  1. Type in the labels for each category (Corporate, Residential, Nonprofit).
  2. Choose whether you want one of the options to be a default choice.
  3. Assign a value to each label – making sure that these values match up correctly with the numeric values in the corresponding CustType field (1=Corporate; 2=Residential; 3=Nonprofit).
  4. Store the value in the appropriate field that contains the numeric values. In this case, the field was CustType.
  5. Choose the type of control you want – option button, checkbox, or toggle button. The option button is shown below. You may also choose a style.
  6. Give the option group a caption (Type of Customer).
  7. Click Finish.

(You may want to right-click on the control and set a background or fill color). The final result will look something like this:

Option group



Leave a Reply

Your email address will not be published. Required fields are marked *