How to Create a Value List Combo Box

How to Create Combo box with Data Source from the Value List

In this how to, I will show the step of creating the combo box with the data source from the value list by manually entering data into the list. In this example, I will enter a type of gender 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 will type in the values that I want” then click Next> button, see picture below.

select value

4. Enter a type of gender “Male, Female and N/A” for the customer gender then click Next > button
type value

5. Name a combo box label as Gender then click Finish button
name gender

6. Double click on the combo box to open a Property Sheet. Change name of combo box to “cboGender” on the property window
name combo box

7. Under the Event property, select the Event Procedure on the After Update Event and click on 3 dots (…) to add the VBA code.

event pro

8. Enter this code under the After Update Event of combo box. Gender is a text or string for vba. Please make sure you put single quotation mark (‘) in front and after of the double quotation make(“) of Me.cboGender shown in the picture below.

gender code

9. In this example, I have a subform name tbl_Customer subform inserted into the Form Detail Section. I want to show only customers with the gender matching with the gender type that I
selected on the combo box.

add subform

10. After I selected “Male” gender from the combo box then the subform will display only the male customers shown below.

gender result

Video Link:

1. How to Create Search Form using Combo Box

 

 

Related posts