Project and Contact Database

  • Thread starter Thread starter jessa13177
  • Start date Start date
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.
 
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.
 
Back
Top