I have searched and searched for an answer to this but seem to cannot come up with anything that will work.
I have an unbound form with a combobox that is used as criteria to display the contact information for a given supplier. The results are displayed in a continuous subform. The subform is based on a query from multiple tables. I can get the relevant information to show up on combobox selection. What I would like to do is be able to add another contact to the supplier selected. When I go to add I receive an error of join key not in recordset.
My understanding is since some of the relationships I created are not linked PK to PK it will not let me add records. I've seen a solution that requires making multiple subforms but that seems unnecessary especially since I want to be able to add to a supplier already selected. I have posted the SQL below.
I would like to note I am not very experienced with SQL but have grown to understand VBA quite well.
This is a first post to the site but have used solutions found here for other things and they have always worked perfectly. Thank you in advance for any help provided.
I have an unbound form with a combobox that is used as criteria to display the contact information for a given supplier. The results are displayed in a continuous subform. The subform is based on a query from multiple tables. I can get the relevant information to show up on combobox selection. What I would like to do is be able to add another contact to the supplier selected. When I go to add I receive an error of join key not in recordset.
My understanding is since some of the relationships I created are not linked PK to PK it will not let me add records. I've seen a solution that requires making multiple subforms but that seems unnecessary especially since I want to be able to add to a supplier already selected. I have posted the SQL below.
I would like to note I am not very experienced with SQL but have grown to understand VBA quite well.
This is a first post to the site but have used solutions found here for other things and they have always worked perfectly. Thank you in advance for any help provided.
Code:
SELECT tblSuppliers.Supplier,
tblSupplierCodes.SupplierCode,
tblContactType.Type,
tblContactInfo.[Contact Name], tblContactInfo.[Contact Email]
FROM (tblSuppliers INNER JOIN tblSupplierCodes ON
tblSuppliers.ID = tblSupplierCodes.[Supplier ID]) INNER JOIN (tblContactType INNER JOIN
tblContactInfo ON tblContactType.TypeID = tblContactInfo.TypeID) ON
tblSuppliers.ID = tblContactInfo.SupplierID
WHERE (((tblSuppliers.Supplier)=[Forms]![frmContactMenu]![cboSupplierContactSelect])) OR
((([Forms]![frmContactMenu]![cboSupplierContactSelect]) Is Null));