title | keywords | f1_keywords | ms.service | ms.assetid | ms.date | ms.localizationpriority | |
---|---|---|---|---|---|---|---|
Option Group Control |
vbaac10.chm13398 |
|
access |
a67b22b7-d3a8-c9c6-cb1b-a6d544b2fefe |
06/08/2017 |
medium |
Applies to: Access 2013 | Access 2016
An option group on a form or report displays a limited set of alternatives. An option group makes selecting a value easy since you can just click the value you want. Only one option in an option group can be selected at a time.
An option group consists of a group frame and a set of check boxes, toggle buttons, or option buttons.
If an option group is bound to a field, only the group frame itself is bound to the field, not the check boxes, toggle buttons, or option buttons inside the frame. Instead of setting the ControlSource property for each control in the option group, you set the OptionValue property of each check box, toggle button, or option button to a number that's meaningful for the field to which the group frame is bound. When you select an option in an option group, Microsoft Access sets the value of the field to which the option group is bound to the value of the selected option's OptionValue property.
Note
The OptionValue property is set to a number because the value of an option group can only be a number, not text. Microsoft Access stores this number in the underlying table. In the preceding example, if you want to display the name of the shipper instead of a number in the Orders table, you can create a separate table called Shippers that stores shipper names, and then make the ShipVia field in the Orders table a Lookup field that looks up data in the Shippers table.
An option group can also be set to an expression, or it can be unbound. Use an unbound option group in a custom dialog box to accept user input and then carry out an action based on that input.
- Access for developers forum
- Access help on support.office.com
- Access help on answers.microsoft.com
- Search for specific Access error codes on Bing
- Access forums on UtterAccess
- Access wiki on UtterAccess
- Access developer and VBA programming help center (FMS)
- Access posts on StackOverflow
[!includeSupport and feedback]