Display subform confrol total to mainform (1 Viewer)

moi

Member
Local time
Tomorrow, 05:51
Joined
Jan 10, 2024
Messages
235
I have form and subform, i total amountpaid control in subform and put the sum control on subform form header.. Then i want to display that control in the main form. Pls i need..
 

June7

AWF VIP
Local time
Today, 13:51
Joined
Mar 9, 2014
Messages
5,497
Textbox on main form has expression referening subform textbox.

=[subformcontainername].Form.textboxname
 

moi

Member
Local time
Tomorrow, 05:51
Joined
Jan 10, 2024
Messages
235
I have form and subform, i total amountpaid control in subform and put the sum control on subform form header.. Then i want to display that control in the main form. Pls i need..

Textbox on main form has expression referening subform textbox.

=[subformcontainername].Form.textboxname
No it is not working..
 

June7

AWF VIP
Local time
Today, 13:51
Joined
Mar 9, 2014
Messages
5,497
What does "not working" mean - error message, wrong result, nothing happens?

Show EXACTLY what you tried if you need more help.
 

moi

Member
Local time
Tomorrow, 05:51
Joined
Jan 10, 2024
Messages
235
What does "not working" mean - error message, wrong result, nothing happens?

Show EXACTLY what you tried if you need more help.
Sir it gives me "#Error. This is what i enter in textbox in main form.. =[Form]![sbfrm_payment]![txtmonthlytotal]
 

moi

Member
Local time
Tomorrow, 05:51
Joined
Jan 10, 2024
Messages
235
Sir can you pls provide the syntax then.. I tried the url but 404 server error.
 

June7

AWF VIP
Local time
Today, 13:51
Joined
Mar 9, 2014
Messages
5,497
I already provided syntax. So with your object names, try:
=[sbfrm_payment].Form.[txtmonthlytotal]

This assumes sbfrm_payment is name of container control. Container control might have same name as the form it holds. I always assign a different name.
 

moi

Member
Local time
Tomorrow, 05:51
Joined
Jan 10, 2024
Messages
235
I already provided syntax. So with your object names, try:
=[sbfrm_payment].Form.[txtmonthlytotal]

This assumes sbfrm_payment is name of container control. Container control might have same name as the form it holds. I always assign a different name.
Yes sir, i wrongly address the control name.. Pls bear with me, i just started learning ms access.. If you know/have a link where i can download a demo db having the basic features for me to disect and learn from it, it would be appdeciated.. Thank you for time.
 

Gasman

Enthusiastic Amateur
Local time
Today, 22:51
Joined
Sep 21, 2011
Messages
14,473
Yes sir, i wrongly address the control name.. Pls bear with me, i just started learning ms access.. If you know/have a link where i can download a demo db having the basic features for me to disect and learn from it, it would be appdeciated.. Thank you for time.
Yes, you have to get the names correct. That is pretty essential.
Then comes the syntax,
 

AccessBlaster

Registered User.
Local time
Today, 14:51
Joined
May 22, 2010
Messages
6,002
I removed the second "dot" and replaced with the "bang" and removed the brackets around the textbox.

=[sbfrm_payment].Form!txtmonthlytotal
 

June7

AWF VIP
Local time
Today, 13:51
Joined
Mar 9, 2014
Messages
5,497
Either work but bang will prompt list of object names whereas dot lists properties.

In VBA the dot will provoke intellisense listing properties and in some situations object names as well.

Access will likely throw the brackets back in.
 

Cotswold

Active member
Local time
Today, 22:51
Joined
Dec 31, 2020
Messages
531
Yes sir, i wrongly address the control name.. Pls bear with me, i just started learning ms access.. If you know/have a link where i can download a demo db having the basic features for me to disect and learn from it, it would be appdeciated.. Thank you for time.
Take a look at the following:


In the Access Programmers forum see:
Code Repository
Microsoft Access Tutorials
Sample Databases


See if you can get hold of a copy of Access 2000 Developers Handbook Volume 1 by Litwin, Getz & Gilbert
Even the Access 97 version of the same book will be worth buying if you cannot buy the 2000 one. Both old but much is still applicable today.
(don't be tempted with Volume 2 just yet).
Unfortunately they do not do books like that now. In fact they don't write Access books for programmers at all. There are other later books printed but not of the same standard. Today only a few for the Dummies who hope to use Access by clicking around the menus and ribbon here and there.

Maybe also do searches on this forum? Anything you want to know you can safely assume will have been asked many times before. Even an internet search should give results. But better to get the spelling right in your searches.
 
Last edited:

Gasman

Enthusiastic Amateur
Local time
Today, 22:51
Joined
Sep 21, 2011
Messages
14,473
Today only a few for the Dummies who hope to use Access by clicking around the menus and ribbon here and there.
In fact, my bosses a few years back, bought me Access 2007 for Dummies. :)
 

Users who are viewing this thread

Top Bottom