You can create an option group (option group: A frame that can contain check boxes, toggle buttons, and option buttons on a form or report. You use an option group to present alternatives from which the user can select a single option.) on your own or, if you are working in a form or report, you can use a wizard to create an option group. A wizard speeds up the process of creating an option group because it does all the basic work for you. When you use a wizard, Microsoft Access prompts you for information, and then creates an option group based on your answers.
In a data access page (data access page: A Web page, published from Access, that has a connection to a database. In a data access page, you can view, add to, edit, and manipulate the data stored in the database. A page can also include data from other sources, such as Excel.), you use option buttons to represent the different values that you can save in the underlying field of the option group. In a form or report, you can use check boxes, option buttons, or toggle buttons to represent the different values that you can save in the underlying field.
Create an option group by using a wizard
Create an option group on my own
- Open a form, report, or data access page in Design view (Design view: A view that shows the design of these database objects: tables, queries, forms, reports, and macros. In Design view, you can create new database objects and modify the design of existing objects.).
- Click the Control Wizards tool in the toolbox (toolbox: A set of tools that is available in Design view for adding controls to a form or report.) if it's selected (selected: A toolbar button always has a border around it when it's selected, even when the pointer is not resting on the button.). This turns off the wizard.
- In the toolbox, click the Option Group tool .
- Do one of the following:
To create an unbound (unbound control: A control that is not connected to a field in an underlying table, query, or SQL statement. An unbound control is often used to display informational text or decorative pictures.) option group, click where you want to place the group frame.
To create a bound (bound control: A control used on a form, report, or data access page to display or modify data from a table, query, or SQL statement. The control's ControlSource property stores the field name to which the control is bound.) option group, click Field List on the toolbar (toolbar: A bar with buttons and options that you use to carry out commands. To display a toolbar, press ALT and then SHIFT+F10.) to display the field list (field list: A window that lists all the fields in the underlying record source or database object, except in data access page Design view. In data access page Design view, it lists all the record sources and their fields in the underlying database.), and then drag the appropriate field or column from the field list to the form, report, or data access page.
Note The control won't be bound if you try to create it by clicking the form, report, or data access page instead of dragging the selected field from the field list.
- In the form or report toolbox, click the Check Box , Option Button , or the Toggle Button tool . In the data access page toolbox, click the Option Button tool.
- Click inside the group frame where you want the upper-left corner of the check box, option button, or toggle button to appear.
- Do one of the following:
On a form or report, if necessary, click the control, click Properties on the toolbar, and then change the OptionValue property to the value that you want the option group to have when you click that control. When you add the first control to an option group on a form or report, Microsoft Access sets its OptionValue property to 1.
On a data access page, click the option button, click Properties on the toolbar, and then change the Value property from on to the value that you want the option group to have when you click that button.
If the option group is bound, the value of the control's OptionValue or Value property is the value that Microsoft Access stores in the underlying table when you click that control.
property set to 1
- clicking this button sets the value of the Ship Via option group to 1 and, if the option group is bound, stores that value in the underlying table..
property set to 2
- clicking this button sets the value of the Ship Via option group to 2 and, if the option group is bound, stores that value in the underlying table.
property set to 3
- clicking this button sets the value of the Ship Via option group to 3 and, if the option group is bound, stores that value in the underlying table.
- Repeat steps 5 through 7 for each control you add to the option group. On a form or report, Access sets the OptionValue property of the second control to 2, the third to 3, and so on.
To facilitate data entry, you can make the most commonly chosen option the default by setting the DefaultValue property of the option group.