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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access Intermediate Table

Status
Not open for further replies.

s1monUK

Technical User
Apr 11, 2005
4
GB
Hi,
I have 2 tables - one contains flowers, another contains bouquets. I cannot make a one to many straight away so i have a composite key in a third table called BouquetDetails - this will tell the user what bouquet has what flowers in.

Ive got my forms working to add bouquets and flowers but i cannot get a form to join the two together using my third table - it keeps saying "A related record in blah blah is needed".

Ive set the third table to have a composite key and still no luck no matter what i do.

I have a diagram of my relationships or I can email my database if you need more info - can anyone point me in the right direction?

many thanks,
Simon.
 
I think u need an ID field in your detail table just to identify each row and eliminate duplicates as follows:

tblFlowers
fldFlower
data:
Rose
Carnation
Daisy

tblBouquets
fldBouquet
data:
RosesCarn
RosesDais
CarnDais


tblBouquetDetails
fldID fldBouquet fldFlower
1 RoseCarn Rose
2 RoseCarn Carnation
3 RoseDais Rose
4 RoseDais Daisy
5 CarnDais Carnation
6 CarnDais Daisy



Thanks!
Barb E.
 
Hi
You will get this error if you try to add a record to your intermediate table that mentions either a flower or a bouquet that you have not put in the flower or bouquet table.
 
Hi - its strange - thats exactly what ive done but when i try to enter - i get the "a related record" error.

here is an image of my diagram - its the 3 tables from the left im working on.


can you see an obviouse problem?

Simon
 
Hi check your last 2 relationships you have related orders to bouquets and visa versa.
 
Your join between tblBouquetContents and tblBouquet should be between both BouquetID fields. You are joinining the FlowerID field to the BouquetID field and getting an error.



Thanks!
Barb E.
 
thanks barb, but if you do that you get a one to one - oh man! can it be done?
 
If you doubleclick the relationship line, you can select the one-to-many option which will show every record and tblBouquetContents and only those in tblBouquet that match.



Thanks!
Barb E.
 
but any other apart frmo what i have now changes to a one to one.
 
hmmm. check the properties for the fields in tblBouquetContent to make sure the primary keys are set as both FlowerID and BouquetID (i think u said you have a composite) and make sure that duplicates are allowed.

Thanks!
Barb E.
 
Hi
Have you noticed that you have related OrderID in tblOrderLine to BouquetID in tblBouquet? Also you have related BouquetID in tblOrderLine to OrderID in tblOrders. This seems an unlikely set-up.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top