By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,705 Members | 1,815 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,705 IT Pros & Developers. It's quick & easy.

1 to Many Relation In a Subform

P: 3
In my effort to create an order management database, I have established a one to many relation between my tables orders and order details.

Tables:
Orders: Customer, shipping method, etc. Primary key: OrderIndex
Order details: A list of products on this order. Primary key: DetailIndex

Relation:
OrderIndex occurs once in "Orders", but many times in "Order details"

My problem:
I have created a form that (supposedly, although not in actuality) will let me enter an order. It has a subform that will let me enter the details for that order, ie, the list of products. Unfortunately, the subform won't update OrderIndex to correspond to the parent form's OrderIndex. As a result, the data does not get stored correctly. Nor does it display correctly when I try to create a new order (all of the order details appear for the new order, in other words, the subform doesn't filter according to the parent forms OrderIndex). Does anyone know how to handle this? Also, if its a choice between macros and coding in VB, I'd rather go with VB.

Thank you,
Pete Stevenson
Dec 11 '06 #1
Share this Question
Share on Google+
2 Replies


NeoPa
Expert Mod 15k+
P: 31,656
I'm no great expert here, but look at the Link Criteria between the Master and the Sub forms.
Dec 11 '06 #2

MMcCarthy
Expert Mod 10K+
P: 14,534
Pete,

Can I just confirm that the tables are as follows:

Orders
OrderIndex (Primary Key)
Customer
shipping method

Order details
DetailIndex (Primary Key)
OrderIndex (Foreign Key)

In the relationships window can you confirm that the relationship is fully cascading. The cascade updates, deletes, etc. check boxes are all ticked in the properties of this relationship.

Mary
Dec 11 '06 #3

Post your reply

Sign in to post your reply or Sign up for a free account.