Multiple subforms on a form.

A

Artstitches

I am trying to creat a from with 2 subfroms. The first links directly to the
main form, the second links to the first subform. I have created the 2
subforms, and am able to nest the second subform into the first, with the
correct data expanding out when I click on a record. I would however rather
have both forms in the main screen and be able to click on the record in the
first subform and show the corresponding data in the second subform. I have
tried to do this but all records show up, not just the ones that I need. The
northwind database does this with their orders form but I can't work out how
- please help
 
R

Rick Brandt

Artstitches said:
I am trying to creat a from with 2 subfroms. The first links
directly to the main form, the second links to the first subform. I
have created the 2 subforms, and am able to nest the second subform
into the first, with the correct data expanding out when I click on a
record. I would however rather have both forms in the main screen
and be able to click on the record in the first subform and show the
corresponding data in the second subform. I have tried to do this
but all records show up, not just the ones that I need. The
northwind database does this with their orders form but I can't work
out how - please help

You need to set the MasterLink property of the second subform so that it
references the first subform's matching field(s). It is the entries in
MasterLink and ChildLink that control the filtering and the automatic
propogation of key fields on new records.
 
A

Artstitches

I thought that that was what was missing, but I don't how. Can you help with
what I should put into those fields? (I should mention that I'm relatively
new to Access and using Access 2003)

Sophie
 
A

Artstitches

Still having trouble....

when I input the information I get a message that says " the expression you
entered contains invalid syntax.. you may have enetered an operand without an
operator"

I am entering into the control source box of the textbox:

=CI Action subform.CI Request form.CIActionID

Where - CI Action subform - is the name of my first subform
- CI Request form - is the name of my main form
- CIActionID - is the name of the linking field between the 2
subforms.

Could it be that my form names and field names have spaces? Or am I
entering the Control Source incorrectly?
 
A

Artstitches

PROBLEM SOLVED!!!!!

I removed the spaces from the field names and form names and that fixed the
expression error. Then I did some fiddling with the expression until I
stumbled on the correct one. The right control source is...

=CIActionssubform.Form!CIActionID

where - CIACtionssubform - is the first subform
- CIActionID - is the field I want to link.

I was replacing the word form with the form name - which was wrecking things.

Thanks for your help!!!
 
Top