Adding from Subform to Subform

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a tab control that has 6 tabs and a subform one each tab. On the last
subform want to add together fields from the other subforms + one from the
last subform. In the control source of the final calculated field, I had the
following expression:
=(Forms!sbf1Pts![1_Pts])+(Forms!sbf2Pts![2_Pts])+(Forms!sbf3Pts![2_Pts])+etc.

For some reason, all I get on the last subform is #Name?

Can anyone give me a hand on this one please?

Thanks,
Todd
 
Hi, north-bc. Because a subform is itself a control, you need to use the
reserved word Form to get at its controls. It's also good practice to demit
all objects with brackets. Try:

=(Forms![sbf1Pts].Form![1_Pts])+
(Forms![sbf2Pts].Form![2_Pts])+
(Forms![sbf3Pts].Form![2_Pts])+etc.

Hope that helps.
Sprinks
 
Thanks for your help on this one. I did what you said, and I am still
getting the same problem. The wierd thing is that when I typed in what you
had there, this is what it changed it to:
=(Forms!sbf1Pts.Form![1_Pts])+(Forms!sbf2Pts.Form![2_Pts]) --it took out the
brackets around the control (sbf1Pts).

Thanks,
Todd

Sprinks said:
Hi, north-bc. Because a subform is itself a control, you need to use the
reserved word Form to get at its controls. It's also good practice to demit
all objects with brackets. Try:

=(Forms![sbf1Pts].Form![1_Pts])+
(Forms![sbf2Pts].Form![2_Pts])+
(Forms![sbf3Pts].Form![2_Pts])+etc.

Hope that helps.
Sprinks

north-bc said:
I have a tab control that has 6 tabs and a subform one each tab. On the last
subform want to add together fields from the other subforms + one from the
last subform. In the control source of the final calculated field, I had the
following expression:
=(Forms!sbf1Pts![1_Pts])+(Forms!sbf2Pts![2_Pts])+(Forms!sbf3Pts![2_Pts])+etc.

For some reason, all I get on the last subform is #Name?

Can anyone give me a hand on this one please?

Thanks,
Todd
 
Back
Top