I have a form which is based on the following query. The two tables are related: tblContacts has the primary key ID (Autonumber) and since each contact may produce more than one commodity, tblCommodities.ID is a foreign key.
SELECT DISTINCT tblContacts.ID, tblContacts.[Last Name], tblContacts.[First Name], tblContacts.Company, tblContacts.Phone, tblContacts.Phone2, tblContacts.Cell, tblContacts.Fax, tblContacts.[E-mail]
FROM tblContacts LEFT JOIN tblCommodities ON tblContacts.ID = tblCommodities.ID
WHERE (((tblCommodities.Commodity)="Blueberries"))
ORDER BY tblContacts.[Last Name], tblContacts.[First Name], tblContacts.Company;
I would like to be able to edit the tblContacts fields from the form but it seems the Distinct statement prevents me from doing so. When I remove Distinct I can edit, but of course the problem is duplicate records show up.
Any ideas?
Thanks,
Eadie
SELECT DISTINCT tblContacts.ID, tblContacts.[Last Name], tblContacts.[First Name], tblContacts.Company, tblContacts.Phone, tblContacts.Phone2, tblContacts.Cell, tblContacts.Fax, tblContacts.[E-mail]
FROM tblContacts LEFT JOIN tblCommodities ON tblContacts.ID = tblCommodities.ID
WHERE (((tblCommodities.Commodity)="Blueberries"))
ORDER BY tblContacts.[Last Name], tblContacts.[First Name], tblContacts.Company;
I would like to be able to edit the tblContacts fields from the form but it seems the Distinct statement prevents me from doing so. When I remove Distinct I can edit, but of course the problem is duplicate records show up.
Any ideas?
Thanks,
Eadie