Solved Link Subform 2 to Subform 1 (1 Viewer)

mib1019

Member
Local time
Today, 01:09
Joined
Jun 19, 2020
Messages
88
There will likely be more questions as I expand the capabilities of a working database.

I have a Main Form called [Insertion Orders]. On it is a subform (control name subfrmIODetails). There is a text field in subfrmIODetails called txtDetailID.

As way of explanation, there is currently a text field on the first subform that currently holds all the dates of a given detail record. I may want to use the actual dates for calculations later, so I decided to add this additional subform to capture them in a table.

I have added another subform control to the main form called subfrmAirDates. Its underlying table (tblIODetails_Dates) has three fields: Date_ID (primary autonumber); Detail_ID; Air_Date).

I cannot get the two subforms to sync with each other. The Link Master Field is a text field on the main form (txtLinker) whose control source is =[subfrmIODetails].[Form]![txtDetailID]. That txtLinker field properly updates as I scroll through subfrmIODetails. subfrmAirDates does not change as I scroll. The Child Link is txtDetail_ID, a hidden field on the little subform.

I'm sure this is an easy fix, but I am unable to see it. Maybe it's a forest for the trees thing, or maybe it's Friday, or maybe I'm just thick this afternoon. :)

I'm going to ask another question on this new path when I get this simple problem resolved.

Thanks for all the great advice I continue to get here!
MIB1019
 

Gasman

Enthusiastic Amateur
Local time
Today, 07:09
Joined
Sep 21, 2011
Messages
14,049
I realise that Similar threads are not of any use until you post, but the third entry at the bottom appears to be asking the same question?
 

CJ_London

Super Moderator
Staff member
Local time
Today, 07:09
Joined
Feb 19, 2013
Messages
16,553
I'm somewhat confused by what links what with what. But to link one subform with another, you need to put a hidden control on the main form which is populated with the 'master' field value from your subform. Usual way to do this is in your subform current event put something like

parent.txtmaster=me.master

then the other subform will have the linkmaster property set to txtmaster and the child field to whatever the relevant field is
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 15:09
Joined
May 7, 2009
Messages
19,169
instead of using Expression on txtLinker, remove the expression and update this textbox on the Current Event of [subfrmIODetails]

private sub form_current()
Me.Parent!txtLinker = Me! txtDetailID
end sub

now on the "other subform" ( subfrmAirDates ), add [txtDetailID] as the Link Master Fields, and [ txtDetail_ID] as the Link Child Fields.
 

mib1019

Member
Local time
Today, 01:09
Joined
Jun 19, 2020
Messages
88
Thanks everyone. The problem was not referencing the actual field in the 2nd subform as the Child Link. I appreciate you all pointing me in the right direction.

MIB1019
 

Users who are viewing this thread

Top Bottom