Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Relational Problem Perhaps

Status
Not open for further replies.

Xtremlylost

Technical User
Jul 18, 2002
25
0
0
US
In building a new database I have run into a form level problem that I just cannot figure out. The form has a subform for quote details in it and I am getting a quote record for every record in the details area. 3 details records; 3 quote records and all 3 quote records have the same detail data in them. There should only be one quote record with the subform housing all the details within the quote. I have messed with the linkchild and linkmasters every way I know getting varying effects but not what I am looking for. This is set up as a one-many-many and I don't have any experience with this so it could be the issue.
When I review the table level information it looks fine being able to hit the expand (+) buttons and all the info is where it should from custtbl + quote + quotedetails.

Any idea on where to start to resolve.

Thanks in advance
Xtremlylost

Sometimes the view is perfect right where you are and sometimes falling is the only way to know it.
 
one-many-many"? Relationships are only between two tables and you can't have a many-to-many relationship in a relational database(it doesn't like it).
"custtbl + quote + quotedetails". So you have three tables - custtbl, quote and quotedetails?
You have a one-to-many relationship between quote and quotedetails. You have a many-to-many relationship between custtbl and quote (one customer can have many quotes and a quote can be offered to many customers). So you should have another table, known as a "junction" table between the custtbl and quote. It should look like this:
custquoteID (primary key)
custID (foreign key - primary key of custtbl)
quoteID (foreign key - primary key of quote)

So the customer table is connected to the custquote table through custID, quote is connected to the custquote table through guoteID, and quote is connected to quotedetails through gouteID.
You can then build all of this through a query and base your form and reports off of it.
 
I will give this a shot but there is one thing to consider. Each quote is set up to be considered as a single occurrence. The I had a one-many cust/quote and a one-many between the quote/quotedetails tables. I had heard this was called one-many-many. Just so we are on the same page concerning, that a quote will be individual per occurrence due to the special nature of them - many custom options such as finish which we must match upon receipt of PO.
Will your suggestion work for this scenario?
Xtremlylost

Sometimes the view is perfect right where you are and sometimes falling is the only way to know it.
 
Also, how would I tie this to the quotedetails table?
Xtremlylost

Sometimes the view is perfect right where you are and sometimes falling is the only way to know it.
 
I think there is an example of what you mean this in the Northwind Sample database; look at the form Customer Orders.

Pampers [afro]
Just let it go...
 
Thanks. I looked it over and it has almost the exact structure. I just need to decipher how it is set up versus mine.
Thanks again for the input.

Sometimes the view is perfect right where you are and sometimes falling is the only way to know it.
 
Have a good look at the OnCurrent() of the 1st subform.

Pampers [afro]
Just let it go...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top