how to link master field to textbox on main form

evoingram

New member
Local time
Today, 15:40
Joined
Nov 21, 2016
Messages
1
Hello there,

i am pretty new to access; i can usually edit my way around and figure things out from context, but i am having some trouble figuring out something. i believe i am close to getting it worked out.

I have a main form [MMProcess Jobs].
It has a textbox on it you can type in [JobNumberField].
i have a subform control on the main form [ProcessJobSubform].
It has a bunch of buttons on the left.

WHen i click on one of those buttons, a form comes up within ProcessJobSubform (PJViewJobForm, PJStatusChecklist, and PJOrderingInfoForm are a couple of them).

Each one of these subforms (PJViewJobForm, PJStatusChecklist, etc) has an ID box of its own that copies the main form textbox (VJFJobID, OIFID)

Within each subform, i have three subform controls, each with their own subform. I am going to use PJOrderingInfoForm as the example.

Within that PJOrderingInfo subform, i have three more subform controls on each subform, CasesStatusCheckSubform, VJFCourtDatesSubform, and OrderingAttyInfoSBFM. Each one of these has sourceobject of their own form (see next sentence) and the master field is labeled to [PJOrderingInfo]![OIFID]. The child field for each of these three subform controls is the sub-subform's ID SBFMOrderingAttyInfo.ID, for example.

Each subform control displays their own subform, SBFMCaseInformation, SBFMCourtDates, and SBFMOrderingAttyInfo respectively.

i cannot seem to get them linked up to the main form textbox JobNumberField no matter what i do.

i have tried various formats including ones at access.mvps.org/access/forms/frm0031 in the link child/master fields to set the correct subform/form and i have been doing this via VBA.

They all work separately and it works together EXCEPT it prompts me something like 5-9 times for the same number, i have a feeling because i do not have the master/child fields set correctly for it to pull from the text box.

i have been trying to set the correct master/child fields through vba on button click like so:

Code:
Private Sub JobInfobtn_Click()
Me.ProcessJobSubform.SourceObject = "PJViewJobForm"
Me.ProcessJobSubform.LinkChildFields = "Me!ProcessJobSubform.Form!VJFJobID"
Me.ProcessJobSubform.LinkMasterFields = "Me.Parent.Parent!JobNumberField"
Me.ProcessJobSubform.Requery
End Sub

Do you have any idea what the format would be for this? i am aware of various websites that discuss format like the link above but i have been trying different things from that for over a day now and still am not getting it. It continues to ask me for parameters. So if someone could give me a little prodding in the right direction, i would really appreciate it. Thanks in advance! i apologize if i have left anything out.
 
Last edited:
The link fields need to be simple names of fields or controls. Take the quote marks away to get the values in the controls. Otherwise you will get that string as entered as the link fields properties.
 

Users who are viewing this thread

Back
Top Bottom