Subform linked to parent form data

  • Thread starter Thread starter sarthur
  • Start date Start date
S

sarthur

Guest
I have a form with a combo box showing the Company Name based on the Company ID. The form has a sub-form showing the Employees Name in a combo box. I want the combo box of Employees Name to only show the employees of the company selected in the Company Name combo box (The Employee Table has a Company ID field). I think I should be using Requery, but I can't get it to work. PS: This is causing BIG stress!
 
Try setting the default value of companyid in the subform to the companyid on the main form if the relationship is one to many this should only bring up the employees linked to the particular company.
 
Thanks for your reply Lorraine. I finally worked it out last night:
I had already linked the Employee Name to the Company Name using the Company ID in a Query. This brought up the correct listing for the FIRST record, but when I was changing to another record, the Query needed to be run again. Finally I worked out that this should be done using Requery in the On Current event of the main form. Now the Employee Name list shows only those in the Company!
 

Users who are viewing this thread

Back
Top Bottom