2 tables, sub form and confusion, help please

  • Thread starter Thread starter Matt P.
  • Start date Start date
M

Matt P.

Hello,
Thank you for taking the time to look at this post.
What I am having trouble with is..
I have two tables that have a relationship between them.
The relationship is one field on each table.
Which by looking at the two tables next to each other you
would never be able to tell.
I have a form that has information about one table '1' on
it.
I would like to put a sub form the existing form.
I would like the sub form to contain data from table '2'.
The only catch is that I would like to have the data
displayed in the sub form correlate to the data that
will "currently" be displayed on the form.(Or the record
that is being displayed/selected at that time)
The field on the second table that has the relationship is
not going to be in a control to be displayed..on the sub
form. There are other fields that will be displayed.

I know that I can run a query on one of the controls in
the original form to give me the "record #" that is being
displayed but I'm not sure how to link the data together.
Every time I think that I'm doing it correctly it doesn't
work. Once again thank you for your time.
 
Hey Matt -

You need to set the link child & link master fields of the
subform object on the main form.

To do this select the subform object (click once so you
get handles around it, not twice or you'll actually be
selecting an item in the subform, not the subform
itself). Then open up it's properties (view: propErties)
On the data tab you'll see the two properties I
mentioned "Link Child Field" & "Link Master Field". Enter
the name of the field in the main form in "Link Master
Field" and the name of the field in the child form
in "Link Child Field". You don't have to display the
linking field in the child form

That will make the 2 forms coordinate the way you have in
mind.

If you have the relationships set up correctly between the
two tables, access should automatically fill these out for
you. So I'm suspecting that you don't have your
relationships set up, so you should probably go ahead and
do that, but you can type in the names of the fields if
you want.
 
Back
Top