Show totals of text box on different form

razorking

Registered User.
Local time
Today, 15:48
Joined
Aug 27, 2004
Messages
332
I am struggling with this. Tried searching for the answer as am sure it has been addressed, maybe my search skills are waning as well but, not finding the solution:

I have a form with a subform. The subform has a bound text box that shows dollar values for records (this field/text box is titled - totals). Now I am creating a third form and I want to create a text box on this form to reference, sum and display the contents of the "totals" text box on the aforementioned subform.

I am pretty certain this can be done, as long as the main form/subform is open when the third form is to display the totals - and it will be. But somehow my third form text box will not display the totals from the subform. I get the dreaded #Name? or

My subform and text box fields are named correctly. I think my syntax is not correct. I have: Sum[Forms]![frmQuotes]![Total]

What should I be doing?
 
I can denitely believe I am not referencing the forms correctly. I appreciate the lead but...I am still struggling with the correct syntax on the text box for my new third form. Possibly I am dense, the linked chart is confusing to me.

Suppose my main form is called - frmMain, and my subform is called - frmSub1 and my control is called - total. would I go:
= Forms![frmMain]! Forms![frmSub1]![Total]

That's not working and I am just not geting it.
 
Close......


Forms!frmMain!frmSub1.Form!Total

Edit::

And this all works ONLY if your other forms are open (frmMain w/ frmSub1)
 
Still not working for me. There has to be a way but, what am I missing.

It looks to me like, in reading the chart - I want to be in the section that says:
To refer to a control
And
Not in these forms

because I am referencing a text box and I am not on the main form or on the subfor - I am on a 3rd form (at least that is how I read the chart). So according to that I should reference the control on the sub form like this:

Forms!Mainform!Subform1.Form!ControlName

So, assuming my main form is called - frmMain and my subform is called frmSub1 and my text box is called - total - I would use:

Forms!frmMain!frmSub1.Form!total

But it is not happening. Any ideas??
 
Do you have both forms open at the time?
 
Yes, I make sure the form which contains the subform stays open. I am uploading a screen shot of the form(s) to illustrate. In the image you can see the main form, the subform and the control I am trying to reference which is on the subform.

again, to make it simple let's say:
My main form is called - frmMain
My subform is called - frmSub1
The text box on the subform I want to reference is called - total

So, now I have made a third form. It opens from clicking a button on the form in the image I uploaded. On this new form I want to show the sum of the values in the - total - text box control on frmSub1.

I have double checked the names of my forms and tried different itterations on the syntax to reference the control, sum the values and display on the new, 3rd form but...the #Name? persists. I am about to give up and move in a different direction. I am sure a smart person could do this easily but, my pea brain is struggling with it.
 

Attachments

  • quote form.JPG
    quote form.JPG
    73.5 KB · Views: 188
The only other thing that I can think is to make sure that the subform container name is infact frmSub1 and not something else...

Other than that... I dont know what else to tell you without having you post up a sample of what you have.
 
I am uploading a stripped down version of the db. Open up the frmQuote. Then click on the button to make the non cancel agreement. There is a control on this form - amt2pay. I want this control to display the sum of the values in the Total field on the subform on frmQuote.

upload is a zip because for some reason the .mdb would not upload successfully
 

Attachments

  • Q.zip
    Q.zip
    129.9 KB · Views: 134
upload is a zip because for some reason the .mdb would not upload successfully
Because it was too big.

Anyway, check the revised sample - I

1. Added a text box to get the sum in the footer of the subform.

2. Renamed the totals text box as you can't have the field and name of the text box the same or else it gives error when doing calculated fields.

3. Added the right syntax to refer to the text box on the subform footer.
 

Attachments

Users who are viewing this thread

Back
Top Bottom