totn Access

MS Access 2003: Display a particular subform based on a combo box selection

This MSAccess tutorial explains how to display a particular subform based on a combo box selection in Access 2003 (with screenshots).

Question: In Microsoft Access 2003/XP/2000/97, I need to figure out how to display a particular subform on a main form (I have 3 subforms) based on a combo box selection.

For example, when I select "Customer" in the combo box, I want to display the Customer subform on the main form. When I select "Employee" in the combo box, I want to display the Employee subform ... and so on.

How can I do this?

Answer: We've provided a download to demonstrate how you can select a value from a combo box and then display a particular subform.

Download version in Access 2000

Microsoft Access

In our example, we have 3 subforms called frmJobs_Customers_sub, frmJobs_Employees_sub, and frmJobs_Supplier_sub. We've created all 3 subforms on our main form (frmJobs) - with each subform being placed on top of the next.

Then based on the value chosen in the Template Type combo box, we've hidden the subforms that we don't want to see. So that only the appropriate subform is currently being displayed.