Load an Access Subform Based on a Combo Box Selection
Question details
Display a different subform on a Microsoft Access form based on a combo box selection.
- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- A parent form has a combo box with choices such as A, B, and C, each associated with a different subform.
- Observed behavior
- The desired subform appears in the parent form when the user selects the corresponding combo box value.
Create the forms you want to display and add a combo box and a subform control to the parent form. In Design View, check the controls' Name properties and confirm that the combo box's bound values match the values used in your code.
Change the subform control's SourceObject in the After Update event
Use one subform control and select its source form according to the combo box value.
Open the parent form in Design View. Select the combo box, open the Property Sheet, and check its Name property. Then select the subform control and check its Name property; this can differ from the embedded form's name.
Select the combo box and, on the Property Sheet's Event tab, choose After Update. Select [Event Procedure], then click the ellipsis button to open the VBA editor.
In the generated AfterUpdate procedure, add the following code. Replace cboChoice and subformControl with your control names, and replace the form names with yours: Select Case Me.cboChoice.Value Case "A" Me.subformControl.SourceObject = "Form.frmSubA" Case "B" Me.subformControl.SourceObject = "Form.frmSubB" Case "C" Me.subformControl.SourceObject = "Form.frmSubC" End Select
Save the form, open it in Form View, and choose A, B, and C from the combo box. Confirm that the corresponding form appears in the subform control.
Store subform names in the combo box row source
Use a combo box column to identify the source form instead of listing each choice in a Select Case block.
Use WPS Office for documents, spreadsheets, and presentations
WPS Office is a free, lightweight alternative with a familiar interface and compatibility with common Microsoft Office formats for an easier move between office suites. It does not replace Microsoft Access or run Access form and VBA solutions.

Frequently Asked Questions
Where do I find the subform control's name?
Open the parent form in Design View, select the subform control, and check its Name property in the Property Sheet. Use that control name in the SourceObject assignment, not necessarily the embedded form's name.
Why doesn't the subform change when I select a value?
Check that the combo box's After Update property is set to [Event Procedure], that the code uses the correct control names, and that each Case matches the combo box's bound value. Also confirm that each form named in SourceObject exists.
Can I put the subforms on separate tabs instead?
Yes. In Design View, add a tab control to the parent form and place a separate subform control on each tab page. Users can then choose the tab for the form they want to see.
Will After Update load a subform when the parent form first opens?
Not by itself. After Update runs when the user changes the combo box value. If an initial subform is needed, set the subform control's SourceObject in Design View or add appropriate initialization code to the parent form's Load event.




