How to Create Combo Box

How to Create Combo Box with Data Source from the Table

In this how to, I will show the step of creating the combo box with the data source from the table in current database. In this example, I will use the table customer type for combo box data.

1. Created blank form and right hand click on the Detail black bar to insert the Form Header under the design view

create blankform

2. Under the form design view, click on the combo box icon and paste it on the Form Header section.
combo box

3. Select “I want the combo box to get the value from another table or query” then click Next> button, see picture below.
new combo

4. Select table tbl_Customer_Type from the table list then click Next > button

select cut type

5. Insert Customer_type_ID and Customer_Type fields from the Available fields list to the right box by using double arrow (>>) then click Next> button
cust type

6. Sort it by Customer_Type and click Next>
sort combo box

7. Leave check mark on the “Hide key column” Access will hide the Customer_Type_ID field and show only the Customer_Type field in the combo box. Click Finish button.
finish combobox

8. Double click on the combo box to open a Property Sheet. Under the Event property, select the Event Procedure on the After Update Event and click on 3 dots (…) to add the VBA code.

event procedure

9. In this example, I have my combo box name Combo4 and a subform name tbl_Customer subform2 inserted into the Form Detail Section (How to Create Subform). I want to show only customers with the customer type matching with the customer type that I selected on the combo box. I need to put the code below on the After Update Event of combo box.

code

10. After I selected the Individual of customer type from the combo box then the subform will display only the customers with the customer type of Individual shown below.

filter

Video Link:

1. How to Create Search Form using Combo Box

Related posts