LinkMasterFields

S

Stapes

Hi

I am trying to execute the following code: -

[Forms]![FM_MainDetails]![FMS_Boat_subform]!
[TM_JobDetails_subform].LinkMasterFields = "jobno"

jobno is a hidden control in Form FM_MainDetails.
However, it isn't finding it. Instead it keeps throwing out a dialog
asking me to enter the parameter.

I have tried moving the hidden control to the subform
FMS_Boat_subform, but that made no difference. In another place I
have: -

FMS_Boat_subform.LinkMasterFields = "boatnam"

where boatnam is also a hidden control on the same form
FM_MainDetails. This one works perfectly.

Why the double standard?

Stapes
 
A

Allen Browne

Try including the ".Form" bit to distinguish between the subform control and
the form in that control:

[Forms]![FM_MainDetails]![FMS_Boat_subform].Form![TM_JobDetails_subform].LinkMasterFields
= "jobno"

Explanation:
Referring to Controls on a Subform
at:
http://allenbrowne.com/casu-04.html

If that still doesn't work, open the main form in design view, and check the
Name property of the subform control. The name can be different than the
name of the form loaded into it (its SourceObject.)
 
S

Stapes

Hi

I tried that solution - putting .Form. between Form & subform. It
didn't work. I don't think the problem is with referencing the
LinkChild & LinkMaster fields, because the values are ending up in the
right place. What it is not finding is "jobno" which is a control on
FM_MainDetails. I moved my hidden control to the FMS_Boat_subform -
and it worked !!

Stapes
 

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