Textbox on main form referring to subform control

Sketchin

Registered User.
Local time
Yesterday, 23:13
Joined
Dec 20, 2011
Messages
580
I have a form with a subform which resides in a tabbed control. In that subform, I have a textbox in the footer that sums values in the detail section of the subform.

I have a textbox on my main form that should display the same data that is in my subform footer textbox, but it is giving me the #name? error.

This is the expression in my subform footer textbox (which returns the correct result):

TxtSubtotalHQPCalc -
=Sum([ActualHQPCalc])

And the expression in my main form textbox (which returns #name?):

txtActualHQPValue -
=([subfrmHQPProject].[Form]![TxtSubtotalHQPCalc])

I have verified that my subform name and textbox names are all accurate. This is very frustrating because I am using this exact same method in a different database with no problems!
 
Did you use the Expression Builder to find the control?
 
Argh.....I had my subform named after the table its based on...not subfrmHQPProject.

Thanks for the help!
 
No problem!

Remember there's a difference between the subform and the subform control.
From the parent form you reference the subform control and from the subform control you reference the subform. That's why you use ".Form" to reference the subform itself. Any reference from the parent form must be made to the control housing the form.
 

Users who are viewing this thread

Back
Top Bottom