Linking a Sub-form to a Combo or List Box in the Main Form


Step 1:
Create a form that includes the primary key and name from the main table (exterminator# and exterminatorName).

Step 2:
Create a query that lists all subform fields (contract info and customer #).  Be sure to include the foreign key that is used to link to the main table.

Step 3:
Create a subform based on that query. Select all of the fields that result from the query and then accept the option "Show <query name> for each record in <main table> using <primary key>". Hide the linking field (you may have to resize it in the datasheet view if setting Visible to No fails to work. Set the view to either Continuous Forms or Datasheet View.

Step 4:
In the main form, delete the fields that you inserted in Step 1 (primary key and name from the main table). Add a Combo or List Box that includes both of those fields and opt to hide the key value. Choose the option "Remember value for later use." Change the name property to the same name as the primary key field.

 

For a detailed process description of a specific form, see this link.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Show extQuery for each record in exterminator using exterminator#.