G
GaryS
I'm new to Access but not new to data modeling--in fact, I
teach the latter! But I'd like some suggestions from the
MVPs on how to handle updating n-n relationships using
Forms.
For starters, I have an app now where I've got tA and tB
with a n-n relationship trelAB between them.
trelAB consists only of tA.id and tB.id, which are
Autonumber fields in tA and tB respectively. Those
foreign keys in trelAB are of type Number.
Let's say that tA is the primary table of interest to the
user. I have a Form frmA based on tA, which has several
fields.
Right now, I'm using a Subform to display the related tB
data. The Subform's recordsource is a query that joins tB
with trelAB, so that the parent & child connection between
the main and subforms is simply tA.id.
This arrangement works not only for display but seemingly
also for updates. IOW, if I do a NewRecord in the
Datacontrol selector in the subform display, Access seems
to magically handle the addition properly--that is, a new
row in trelAB and a new row (maybe) in tB.
Question: Am I just lucky in happening upon this
approach, or is subform the "way to go" for n-n rel.
updates?
I would appreciate any light you all could shed on this
matter before I propagate that approach to other
situations in the application!
Gary
teach the latter! But I'd like some suggestions from the
MVPs on how to handle updating n-n relationships using
Forms.
For starters, I have an app now where I've got tA and tB
with a n-n relationship trelAB between them.
trelAB consists only of tA.id and tB.id, which are
Autonumber fields in tA and tB respectively. Those
foreign keys in trelAB are of type Number.
Let's say that tA is the primary table of interest to the
user. I have a Form frmA based on tA, which has several
fields.
Right now, I'm using a Subform to display the related tB
data. The Subform's recordsource is a query that joins tB
with trelAB, so that the parent & child connection between
the main and subforms is simply tA.id.
This arrangement works not only for display but seemingly
also for updates. IOW, if I do a NewRecord in the
Datacontrol selector in the subform display, Access seems
to magically handle the addition properly--that is, a new
row in trelAB and a new row (maybe) in tB.
Question: Am I just lucky in happening upon this
approach, or is subform the "way to go" for n-n rel.
updates?
I would appreciate any light you all could shed on this
matter before I propagate that approach to other
situations in the application!
Gary