Referring to calculated field on subform

D

Dave the wave

I have a subform with a calculated control that is working as expected. I
want the value from the calculated field to appear in the footer of my main
form.

I have followed the Access help screens syntax and even used the Equation
Builder to prevent any typos but I continue to get the #Name error message
in the field on my main form.

Main Form name: frmInvestigationsReview
text box name: tbxSumOfCases
text box control source:
=[Forms]![frmInvestigationsReview]![sfrmInvestigationsReview]![tbxTotalCases
]

Subform name: sfrmInvestigationsReview
text box name: tbxTotalCases
text box control source: sum(RepackTotalCases)

Any hints to what might be the matter. I reviewed all the help information,
and studied the NorthWind example (which does work), but I can not figure
out why my control doesn't.

Thanks in advance.
 
D

Dave the wave

I tried that snippet but got the same response (#Name). I tried loading the
text field using VBA :

Private Sub Form_Current()
Me.tbxSumOfCases.Value =
Forms("sfrmInvestigationsReview").Form![tbxTotalCases]
End Sub

I got an error message saying it can't find the form
"sfrmInvestigationsReview", which really strikes me as being strange since
the name is listed among the other form names. (The spelling and text case
are also correct.)

The subform shows up as expected in the main form.

I'm really perplexed over this one.

--
from Dave the wave

^^^^^^\________
Jeff Conrad said:
Try:

=[sfrmInvestigationsReview].[Form]![tbxTotalCases]

--
Jeff Conrad
Access Junkie
Bend, Oregon
< 5 Days Left >

I have a subform with a calculated control that is working as expected. I
want the value from the calculated field to appear in the footer of my main
form.

I have followed the Access help screens syntax and even used the Equation
Builder to prevent any typos but I continue to get the #Name error message
in the field on my main form.

Main Form name: frmInvestigationsReview
text box name: tbxSumOfCases
text box control source:
=[Forms]![frmInvestigationsReview]![sfrmInvestigationsReview]![tbxTotalCases
]

Subform name: sfrmInvestigationsReview
text box name: tbxTotalCases
text box control source: sum(RepackTotalCases)

Any hints to what might be the matter. I reviewed all the help information,
and studied the NorthWind example (which does work), but I can not figure
out why my control doesn't.

Thanks in advance.
 
D

Dave the wave

I figured it out. The name value of the subform on the main form was set to
the name of its underlying query. Once I changed the name value to
"sfrmInvestigationsReview", everything worked as expected.

Thanks for your help

--
from Dave the wave

^^^^^^\________
Dave the wave said:
I tried that snippet but got the same response (#Name). I tried loading the
text field using VBA :

Private Sub Form_Current()
Me.tbxSumOfCases.Value =
Forms("sfrmInvestigationsReview").Form![tbxTotalCases]
End Sub

I got an error message saying it can't find the form
"sfrmInvestigationsReview", which really strikes me as being strange since
the name is listed among the other form names. (The spelling and text case
are also correct.)

The subform shows up as expected in the main form.

I'm really perplexed over this one.

--
from Dave the wave

^^^^^^\________
Jeff Conrad said:
Try:

=[sfrmInvestigationsReview].[Form]![tbxTotalCases]

--
Jeff Conrad
Access Junkie
Bend, Oregon
< 5 Days Left >

I have a subform with a calculated control that is working as
expected.
=[Forms]![frmInvestigationsReview]![sfrmInvestigationsReview]![tbxTotalCases
]

Subform name: sfrmInvestigationsReview
text box name: tbxTotalCases
text box control source: sum(RepackTotalCases)

Any hints to what might be the matter. I reviewed all the help information,
and studied the NorthWind example (which does work), but I can not figure
out why my control doesn't.

Thanks in advance.
 
J

Jeff Conrad

Ahh yes, using the *correct* name does help!
;-)

You're welcome, glad to help.

--
Jeff Conrad
Access Junkie
Bend, Oregon
-----Original Message-----
I figured it out. The name value of the subform on the
main form was set to the name of its underlying query.
Once I changed the name value to
"sfrmInvestigationsReview", everything worked as expected.

Thanks for your help

--
from Dave the wave

^^^^^^\________
Dave the wave said:
I tried that snippet but got the same response (#Name).
I tried loading
the
text field using VBA :

Private Sub Form_Current()
Me.tbxSumOfCases.Value =
Forms("sfrmInvestigationsReview").Form![tbxTotalCases]
End Sub

I got an error message saying it can't find the form
"sfrmInvestigationsReview", which really strikes me as being strange since
the name is listed among the other form names. (The spelling and text case
are also correct.)

The subform shows up as expected in the main form.

I'm really perplexed over this one.

--
from Dave the wave

^^^^^^\________
Jeff Conrad said:
Try:

=[sfrmInvestigationsReview].[Form]![tbxTotalCases]

--
Jeff Conrad
Access Junkie
Bend, Oregon
< 5 Days Left >

I have a subform with a calculated control that is
working as
expected.
I
want the value from the calculated field to appear
in the footer of my
main
form.

I have followed the Access help screens syntax and
even used the
Equation
Builder to prevent any typos but I continue to get
the #Name error
message
in the field on my main form.

Main Form name: frmInvestigationsReview
text box name: tbxSumOfCases
text box control source:
=[Forms]![frmInvestigationsReview]!
[sfrmInvestigationsReview]![tbxTotalCases
]

Subform name: sfrmInvestigationsReview
text box name: tbxTotalCases
text box control source: sum(RepackTotalCases)

Any hints to what might be the matter. I reviewed
all the help
information,
and studied the NorthWind example (which does
work), but I can not
figure
out why my control doesn't.

Thanks in advance.


.
 

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