L
Lynn
Thanks for your assistance Tina. I don't think I
explained myself enough. With what I have read about
many to many relationships, it stated that you had to set
up a combined primary key with the primary keys from the
two tables.
My problem is that each job may not have a Quote and each
Quote may not lead to a job. I initially was going to
set it up this way but it will not work for what we
need. I need to be able to track all Quotes and there
may be many different Quotes pertaining to one job or a
Job may not happern.
I have Customers that may have Quotes and Jobs and I may
have many quotes for one customer and the same with the
jobs. I have tried to think of a way to link the quotes
and jobs but it does not work.
Then to complicate the database even more I have Extra
Work information that needs to tie into the Jobs. This
should only be a one to many relationship.
Thank you for your assistance and I hope this information
better describes my problem.
explained myself enough. With what I have read about
many to many relationships, it stated that you had to set
up a combined primary key with the primary keys from the
two tables.
My problem is that each job may not have a Quote and each
Quote may not lead to a job. I initially was going to
set it up this way but it will not work for what we
need. I need to be able to track all Quotes and there
may be many different Quotes pertaining to one job or a
Job may not happern.
I have Customers that may have Quotes and Jobs and I may
have many quotes for one customer and the same with the
jobs. I have tried to think of a way to link the quotes
and jobs but it does not work.
Then to complicate the database even more I have Extra
Work information that needs to tie into the Jobs. This
should only be a one to many relationship.
Thank you for your assistance and I hope this information
better describes my problem.
tblProductOrders (or OrderDetails).-----Original Message-----
tblCustomers
CustID (primary key)
other fields about the customer
tblCustQuotes (one-to-many relationship with tblCustomers)
QuoteID (primary key)
CustID (foreign key from tblCustomers)
other fields about the quote as a whole
tblQuoteDetails (one-to-many relationship with tblQuotes)
QDetailID (primary key)
QuoteID (foreign key from tblCustQuotes)
other fields about the line item of the quote
tblJobs (one-to-one relationship with tblQuotes)
JobID (foreign key from tblQuotes is the primary key here)
other fields about the job as a whole
tblJobDetails (one-to-many relationship with tblJobs)
JDetailID (primary key)
JobID (foreign key from tblJobs)
other fields about the line item of the job
the above assumes that each quote belongs to one customer, and that each job
stems from one specific quote that the customer accepted, which is why
tblJobs is linked to tblQuotes and not directly to tblCustomers. in a
one-to-one relationship, typically both tables use the same primary key.
from your description, i don't see a many-to-many relationship at all. but
maybe i am misunderstanding your concept.
also, i get the impression you don't have a firm grasp on the meanings of
one-to-many and many-to-many. here's how they work:
one-to-many
one record in tblA may link to many records in tblB, *but* each record in
tblB only links to one record in tblA.
Orders and OrderDetails is a classic example of one-to- many.
many-to-many
one record in tblA may link to many records in tblB, *and* one record in
tblB may link to many records in tblA.
Orders and Products is a classic example of many-to- many. to express this
relationship, you need a linking table -
..also, here's one-to-one:
one record in tblA links to only one record in tblB, *and* one record in
tblB links to only one record in tblA.
remember that to determine the type of relationship, you have to consider
the link from A to B, *and also* consider the link from B to A. always look
at "both sides" of the link.
hth
.