I have a form based on a table (tblCompanyName) with a subform embedded in it based on another table (tblContacts).
When the user clicks my search button they can search on criteria based on tblCompany name and the result is fine, my subform displays related data.
However, if the user wants to search on criteria from tblContacts I run the query below and it brings back the correct amount of records in teh main form but none of the related records are displayed in the subform. How can this be done?
"SELECT * FROM tblcompanyname INNER JOIN tblcontacts ON CompanyID = CompanyID WHERE (((CompanyID)=[companyid]) AND (([CustomerName]) Like '*" & DoubleQuote(Me![cboSelect]) & "*'))"
When the user clicks my search button they can search on criteria based on tblCompany name and the result is fine, my subform displays related data.
However, if the user wants to search on criteria from tblContacts I run the query below and it brings back the correct amount of records in teh main form but none of the related records are displayed in the subform. How can this be done?
"SELECT * FROM tblcompanyname INNER JOIN tblcontacts ON CompanyID = CompanyID WHERE (((CompanyID)=[companyid]) AND (([CustomerName]) Like '*" & DoubleQuote(Me![cboSelect]) & "*'))"