trouble with nested subform - help?!

  • Thread starter Slez via AccessMonster.com
  • Start date
S

Slez via AccessMonster.com

I am really struggling trying to get a second nested subform to populate with
the related data. I am self taught and do pretty well except when it comes
to linking subforms. It always seems to kick me in the butt.

Here is my structure:
mainform is called Form1
1st subform is called qryActiveHoldItems subform
2nd subform is called qryComponentVisible subform1

The control in the main form on the one side of the relationship is Combo4,
which contains data from the JobNumber field.

qryActiveHoldItems subform has Link Child Field set to: JobNumber
Link Master Field is set to: Combo4
(Incidentally, I had received help to get this far via a post earlier today.
This works properly.)
The 2 fields in the 1st subform that are on the one side of this relationship
are RoomNumber & ItemNumber.

qryComponentVisible subform1 returns all records related to the the first
record in the mainform, so I added the following links:
Link Child Field set to: JobNumber;RoomNumber;ItemNumber
Link Master Field set to: [qryActiveHoldItems subform].Form![JobNumber];
[qryActiveHoldItems subform].Form![RoomNumber];[qryActiveHoldItems subform].
Form![ItemNumber]

Now it returns nothing in the 2nd subform.
Any suggestions? Thanks in advance for any help!
 
G

Graham Mandeno

Is the second subform located in a control on the main form, or on the first
subform?

If it's on the first subform, then set its LinkMasterFields to:
JobNumber;RoomNumber;ItemNumber

If it's on the main form, then add two hidden textboxes to the main form:
txtRoomNumber, ControlSource: =[qryActiveHoldItems
subform].Form![RoomNumber]
and
txtItemNumber, ControlSource: =[qryActiveHoldItems
subform].Form![ItemNumber]

Now set its LinkMasterFields to:
Combo4;txtRoomNumber;txtItemNumber
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top