M
msaccess
I am trying to make an address book db. I have 3 tables:
Company, CompanyAddress, and Contacts. Primary keys are CompanyID,
AddressID, and ContactID respectively. The CompanyAddress table allows
me to store multiple addresses for each company. In Contacts Table I
have included fields for Company and Address. While entering contact
Info I want to let the user be able to lookup values from Company and
CompanyAddress Table. I used the lookup wizard and it was easy to
lookup the company name. When I did same for company address, I
obviously end up with all address values in CompanyAddress table. I
want to show only the addresses that belong to the company that has
been already selected.. Any ideas on how to change the select query..
or any other way to get same results.
at present I have following query for Lookup.rowsource
SELECT CompanyAddress.AddressID, CompanyAddress.City,
CompanyAddress.State FROM CompanyAddress;
Company, CompanyAddress, and Contacts. Primary keys are CompanyID,
AddressID, and ContactID respectively. The CompanyAddress table allows
me to store multiple addresses for each company. In Contacts Table I
have included fields for Company and Address. While entering contact
Info I want to let the user be able to lookup values from Company and
CompanyAddress Table. I used the lookup wizard and it was easy to
lookup the company name. When I did same for company address, I
obviously end up with all address values in CompanyAddress table. I
want to show only the addresses that belong to the company that has
been already selected.. Any ideas on how to change the select query..
or any other way to get same results.
at present I have following query for Lookup.rowsource
SELECT CompanyAddress.AddressID, CompanyAddress.City,
CompanyAddress.State FROM CompanyAddress;