Lesson 34 of 50 – Combo Boxes in MS Access
68%

Combo Boxes in MS Access

A Combo Box in Microsoft Access is a form control that displays a drop-down list of values. Users can select an item from the list instead of typing it manually. Combo Boxes are useful for selecting courses, cities, categories, payment modes, and other predefined values.

1. What Is a Combo Box?

A Combo Box combines a text box with a drop-down list. Depending on its properties, users can select an existing value or enter a value manually.

Example: Course Selection
Illustrative example of a Combo Box.
Uses of Combo Boxes
  • Selecting a course during student admission.
  • Selecting a city or state.
  • Selecting a payment method.
  • Selecting a department or category.
  • Choosing a related record, such as a student or teacher.

2. Creating a Combo Box

Follow these steps to create a Combo Box in MS Access:

  1. Open your Access database.
  2. Open the required form in Design View.
  3. Select the Design tab on the ribbon.
  4. Ensure Use Control Wizards is enabled if you want guided setup.
  5. Select the Combo Box control from the Controls group.
  6. Click the location where you want the Combo Box.
  7. Follow the Combo Box Wizard, if it opens.
  8. Configure the list source and stored value as required.
  9. Finish the wizard and save the form.
  10. Open the form in Form View to test the Combo Box.
Tip: If the Combo Box Wizard does not appear, check whether Use Control Wizards is enabled. You can also configure the control manually through the Property Sheet.

3. Types of Combo Box Row Sources

A Combo Box can obtain its list values from different sources. The Row Source Type property determines how Access interprets the Row Source.

Row Source Type Purpose Example
Table/Query Gets values from a table or query. Course names from Courses table
Value List Uses a manually entered list of values. Cash; UPI; Bank Transfer
Field List Displays fields available in a record source. StudentID; StudentName; Course

Choose the source that best suits the data you want users to select.

4. Using a Value List

A Value List is useful when the list contains a small number of fixed choices that do not need to come from another table.

Example: Payment Mode

Suppose users can choose from these payment methods:

  • Cash
  • UPI
  • Bank Transfer
Configure the Combo Box
  1. Open the form in Design View.
  2. Select the Combo Box.
  3. Open the Property Sheet by pressing F4.
  4. Open the Data tab.
  5. Set Row Source Type to Value List.
  6. Set Row Source to the following values.
Cash;UPI;Bank Transfer

The Combo Box will display these three choices. Configure its Control Source if the selected value needs to be saved to a field.

5. Getting Values from a Table

When list values are stored in another table, use Table/Query as the Row Source Type. This makes the list easier to maintain when records are added or changed.

Example: Courses Table
CourseID CourseName
1 ADCA
2 Tally Prime
3 Web Development
4 Python Programming
SQL for the Row Source
SELECT CourseID, CourseName
FROM Courses
ORDER BY CourseName;
Configuration Steps
  1. Open the form in Design View.
  2. Select the Combo Box.
  3. Open the Property Sheet and select the Data tab.
  4. Set Row Source Type to Table/Query.
  5. Set Row Source to the SQL statement above, or select the Courses table/query using the builder.
  6. Set Bound Column to 1 if you want to store CourseID.
  7. Set Column Count to 2.
  8. Set Column Widths to hide the ID and show the course name, for example 0cm;5cm.
  9. Save the form and test the Combo Box.
Important: The example assumes CourseID is a numeric field and the destination field can store that ID. Use compatible data types in related tables.

6. Important Combo Box Properties

Property Purpose
Name Identifies the Combo Box control.
Control Source Specifies the field or expression connected to the control.
Row Source Type Determines whether the list comes from a table/query, value list, or field list.
Row Source Specifies the table, query, SQL statement, or list values.
Bound Column Specifies which column provides the value stored by the control.
Column Count Sets how many columns the list contains.
Column Widths Controls the displayed width of each column.
Limit To List Restricts entries to values in the list when set to Yes.
Default Value Specifies an initial value for a new record.
Auto Expand Helps match typed characters to list entries.

7. Understanding Bound Column

Bound Column specifies which column in a Combo Box supplies the value returned or stored by the control. The first column is column 1, not column 0.

Example
CourseID CourseName
1 ADCA
2 Tally Prime
3 Web Development

If the properties are:

  • Column Count = 2
  • Bound Column = 1
  • Column Widths = 0cm;5cm

The user sees the course name, but the control returns the CourseID. This is useful when storing relationships between tables.

Remember: The displayed value and the stored value do not have to be the same. A Combo Box can display a readable name while storing its corresponding ID.

8. Using Limit To List

The Limit To List property controls whether users can enter values that are not in the Combo Box list.

Limit To List = Yes
  • Users must choose a value from the list.
  • Values outside the list are not accepted as valid entries.
  • Useful for fixed course names and categories.
Limit To List = No
  • Users may enter a value that is not in the list, depending on the control configuration.
  • Useful when additional values may be entered manually.
How to Change the Property
  1. Open the form in Design View.
  2. Select the Combo Box.
  3. Press F4 to open the Property Sheet.
  4. Select the Data tab.
  5. Find Limit To List.
  6. Choose Yes or No.
  7. Save the form and test it.

9. Combo Box vs Text Box

Text Box Combo Box
Usually allows direct typing. Displays a list of choices and may also allow typing.
Useful for names, addresses, and comments. Useful for courses, categories, and predefined values.
Does not automatically provide a list of options. Can obtain options from a table, query, or value list.
May allow many different text values. Can restrict selection to values in its list.

10. Common Problems and Solutions

Problem Possible Solution
Combo Box shows no values. Check Row Source Type, Row Source, and whether the source contains records.
Wrong value is saved. Check Bound Column and the data type of the Control Source field.
Course ID appears instead of the course name. Check Column Count and Column Widths.
Users can enter unwanted values. Consider setting Limit To List to Yes.
Combo Box Wizard does not appear. Enable Use Control Wizards on the Design tab.
Selected value is not saved to a field. Check Control Source and the form's data source.

11. Practical Assignment

Create two tables in MS Access: Students and Courses.

Courses Table
  • CourseID — AutoNumber, Primary Key
  • CourseName — Short Text
Students Table
  • StudentID — AutoNumber, Primary Key
  • StudentName — Short Text
  • CourseID — Number, with a field size compatible with the Courses primary key
  • PaymentMode — Short Text
Tasks
  1. Add at least four courses to the Courses table.
  2. Create a form based on the Students table.
  3. Add a Combo Box for CourseID.
  4. Use Courses as the Combo Box's list source.
  5. Configure the Combo Box to display CourseName and store CourseID.
  6. Add another Combo Box for PaymentMode using a Value List.
  7. Enter Cash, UPI, and Bank Transfer as payment options.
  8. Set Limit To List to Yes for the payment method if appropriate.
  9. Save the form as frmStudentAdmission.
  10. Enter sample records and verify the stored CourseID values.
Goal: Learn to create Combo Boxes, configure their properties, and store selected values correctly.

12. Revision Questions

  1. What is a Combo Box in MS Access?
  2. What are the advantages of using a Combo Box?
  3. What is the purpose of Row Source Type?
  4. What is the difference between a Value List and Table/Query source?
  5. What does the Bound Column property do?
  6. What is the purpose of Column Count?
  7. How can you hide an ID column but display a name?
  8. What does Limit To List control?
  9. What is the difference between a Combo Box and a Text Box?
  10. Why should the stored ID field have a compatible data type?

🧠 Quick Quiz

1. What is the main purpose of a Combo Box?




2. Which property specifies the source of list values?




3. Which property determines the column whose value the Combo Box returns?