top of page

🔢Microsoft Access Option Groups and Lookup Fields

Nov 3

7 min read

0

7

0



Takeaways:

This video provides instructions on utilizing option groups and lookup fields within Microsoft Access to enhance data entry and presentation. It explains how option groups simplify user selection on forms by providing a limited, clickable set of choices, noting that their underlying value is numerical, not textual. The video then details how to create a lookup field in a related table, connecting the numerical values from the option group to corresponding textual descriptions stored in a separate table, ultimately displaying the text while retaining the efficiency of numerical storage. The video also walks through the practical steps of implementing these features within an Access database form and table structure.


Microsoft Access: Option Groups and Table Lookup Fields Study Guide



What is an option group in Microsoft Access?

An option group is a control in a Microsoft Access form that presents a limited set of options to users. It consists of a frame and a collection of either checkboxes, toggle buttons, or option buttons (radio buttons). The key characteristic of an option group is that only one option within the group can be selected at a time.


How does an option group store the selected value?

While an option group displays text labels for each option (like "Cash," "Check," or "Credit Card"), the value that is actually stored in the underlying table is a number. Each option within the group is assigned a unique numerical value (e.g., 1 for Cash, 2 for Check, 3 for Credit Card). The option group stores this numerical value, not the text label.


Why does an option group store a number instead of text?

The value of an option group is restricted to being a number. This is a fundamental design aspect of option groups in Access. Even though the user sees and interacts with text labels, the underlying data representation is numerical.


How can you display the text name associated with the numerical value stored by an option group in a table?

To display the text name (like "Credit Card") instead of the numerical value (like "3") in the underlying table, you need to create a separate table that stores the numerical values and their corresponding text names (e.g., a "Payment Type" table with columns for ID and PaymentTypeName). Then, in the table where the option group's value is stored (e.g., the "Orders" table), you need to make the relevant field a "lookup field" that references the data in the separate table.


How do you create an option group in a Microsoft Access form?

To create an option group, you need to be in the design view of your form. Navigate to the "Form Design Tools" tab and click on the "Option Group" control (often represented by an XYZ with a box around it). Then, click and drag in the form's details area to draw the option group. This will launch a wizard that guides you through defining the option labels, their corresponding numerical values, whether to set a default option, how to store the data (saving for later or storing in a field), the style of the option group (buttons, checkboxes, or toggles), and the caption for the option group.


Can you have a default option selected in an option group?

Yes, the option group wizard allows you to specify a default option that will be automatically selected when the form is opened or a new record is created. However, it's mentioned in the video that sometimes users might forget to change the selection if a default is already set, which is something to consider.


What is the recommended style for an option group?

While you can choose between option buttons, checkboxes, and toggle buttons, the source recommends using option buttons. Checkboxes are generally used for selecting multiple options, which is not the function of an option group (where only one option can be selected). Option buttons clearly indicate the "one choice" nature of the control.


Can changes made through an option group on a form be reflected in the underlying table, and vice versa?

Yes, there is two-way communication. When you select an option in the option group on a form, the corresponding numerical value is stored in the designated field in the underlying table. Conversely, if the numerical value in the table's field is changed directly (e.g., through a datasheet view), the option group on the form will update to reflect the correct selection based on that stored numerical value.





Quiz


  1. What is the primary benefit of using an option group in a Microsoft Access form?

  2. What types of controls can be used within an option group?

  3. What type of data can the value behind the buttons in an option group store? Can it store text?

  4. Why is it necessary to create a separate table to display the text names associated with the numeric values stored by an option group?

  5. How do you initiate the process of creating an option group in form design view?

  6. When creating an option group, what happens after you type in the option names and hit "tab"?

  7. Why is it recommended not to set a default option when creating an option group?

  8. What is a potential drawback of using checkboxes within an option group?

  9. What is the purpose of changing a field's data type to "Lookup Wizard" in table design view?

  10. What does enforcing data integrity in a lookup field relationship mean?





Quiz Answer Key


  1. The primary benefit of using an option group is that it makes it easy for users to select a value from a limited set of options by simply clicking on the desired choice.

  2. An option group can consist of a group frame and a set of either checkboxes, toggle buttons, or option buttons.

  3. The value behind the buttons in an option group can only store a number. It cannot store text.

  4. A separate table is needed because the option group stores a numeric value (like 1, 2, or 3), not the text label (like "Company A," "Company B," or "Company C"). To display the text, a lookup field is created in the main table that links these numbers to the corresponding text names in the separate table.

  5. To initiate the process of creating an option group in form design view, you click on the Option Group control (usually represented by XYZ with a box around it) in the Form Design Tools tab and then click and drag to create the frame on your form.

  6. When creating an option group, after typing in an option name, hitting "tab" allows you to move to the next option name field in the wizard. Hitting "enter" would likely close the dialog box or move to a different step.

  7. It is recommended not to set a default option because users sometimes forget to change the pre-selected option, leading to inaccurate data entry.

  8. A potential drawback of using checkboxes within an option group is that users typically associate checkboxes with the ability to select multiple options, which is not possible with an option group where only one option can be selected at a time.

  9. Changing a field's data type to "Lookup Wizard" allows you to create a link to another table or query so that the field displays values from that source rather than just storing raw data.

  10. Enforcing data integrity in a lookup field relationship prevents users from deleting records in the lookup table that are currently referenced by records in the primary table without receiving a warning or preventing the action.





Glossary of Key Terms


  • Option Group: A control in a Microsoft Access form that allows a user to select one value from a limited set of predefined options. It consists of a group frame and a set of control buttons.

  • Group Frame: The visible border or container that surrounds the options within an option group.

  • Checkboxes: A type of control that can be used within an option group. While typically used for multiple selections, in an option group, only one checkbox can be selected at a time.

  • Toggle Buttons: A type of control that can be used within an option group. They function as on/off switches, but in an option group, only one toggle button can be "on" at a time.

  • Option Buttons: A type of control (also known as radio buttons) commonly used within an option group. They are specifically designed for selecting only one option from a mutually exclusive set.

  • Value: The numeric data that is stored in the underlying table field when a selection is made in an option group. This is distinct from the text label displayed to the user.

  • Lookup Field: A field in a Microsoft Access table that displays values from another table or a value list instead of storing the raw data directly. This is used to display text labels associated with numeric values stored by option groups.

  • Row Source: The source of data for a lookup field or other control, which can be a table, query, or value list.

  • Value List: A predefined list of values that can be used as the source for a lookup field, where the values are typed directly into the field properties.

  • Lookup Wizard: A tool in Microsoft Access that guides you through the process of creating a lookup field, either by referencing another table/query or by defining a value list.

  • Data Integrity: The accuracy, consistency, and reliability of data stored in a database. Enforcing data integrity through relationships and constraints helps maintain the quality of the data.

  • Enforce Data Integrity: A setting in relationships or lookup fields that prevents actions that would violate the integrity of the data, such as deleting a record in a related table if it is still referenced by records in the current table.

  • Design View (Form/Table): A view in Microsoft Access that allows you to modify the structure and layout of forms and tables, adding and rearranging controls and fields.

  • Form View: A view in Microsoft Access that displays a form for data entry and viewing, allowing users to interact with the controls.

  • Datasheet View (Table): A view in Microsoft Access that displays table data in a spreadsheet-like format, allowing for direct data entry and editing.

Related Posts

Comments

Share Your ThoughtsBe the first to write a comment.

1101 Marina Village Parkway

Suite 201

Alameda, CA 94501

bottom of page