Project and Contact Database

J

jessa13177

I have created a database to track Jobs. Each job can have mutiple contacts.
I have a jobs table and form and contacts table and form. how can i create
a subform on the jobs form where i can list all of the contacts related to
the particular job? Each job can have many contacts and each contact can be
related to many jobs.
 
D

Dirk Goldgar

jessa13177 said:
I have created a database to track Jobs. Each job can have mutiple
contacts.
I have a jobs table and form and contacts table and form. how can i
create
a subform on the jobs form where i can list all of the contacts related to
the particular job? Each job can have many contacts and each contact can
be
related to many jobs.


You need to have a table to link Jobs and Contacts. The fields in this
table will include the primary key of the Jobs table and the primary key of
the Contacts table. So, for example, if Jobs has a primary key of JobID (an
autonumber field), and Contacts has a primary key of ContactID (an
autonumber field), then you might have a table named "JobsContacts" with two
fields, JobID and ContactID, both Long Integer fields. The presence of a
record in this table with JobID 1 and ContactID 1 would mean that job 1 is
related to contact 1, and vice versa.

Your subform would then be based on the JobsContacts table, or on a query
that joins the JobsContacts table to the Contacts table and selects the
other fields of interest about the contact from that table. It is crucial
that the query include the JobID and ContactID fields from JobsContacts, not
from the related table.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top