Display Account balance on Main form from sub form transactions (1 Viewer)

mabino79

Member
Local time
Today, 10:37
Joined
Nov 17, 2021
Messages
72
I did say it is the subform control name and NOT THE SUBFORM NAME ???? :(
However as you say it previously worked ???? it appears they are one and the same?

Edit: And you cannot say what the error is? :(
=[Forms]![frmMain]![tblInventoryTransactionSubForm].[Form]![txtTotalQuantityinStock] it worked

added in event & data too.

thanks
but after changing the head its giving #Error.
 

mabino79

Member
Local time
Today, 10:37
Joined
Nov 17, 2021
Messages
72
1641191007897.png


used on Text213 to show the value of Sub Form.

=[Forms]![frmMain]![tblInventoryTransactionSubForm].[Form]![txtTotalQuantityinStock]

sometime it appeared on clicking on the Product some times its not showing the result, giving only errors.
 

Gasman

Enthusiastic Amateur
Local time
Today, 06:07
Joined
Sep 21, 2011
Messages
14,238
View attachment 97274

used on Text213 to show the value of Sub Form.

=[Forms]![frmMain]![tblInventoryTransactionSubForm].[Form]![txtTotalQuantityinStock]

sometime it appeared on clicking on the Product some times its not showing the result, giving only errors.
They say a picture is worth a thousand words, but not in this case. :)

I meant upload a sample DB as you have it now :(
 

mabino79

Member
Local time
Today, 10:37
Joined
Nov 17, 2021
Messages
72
as required uploading the DB.
 

Attachments

  • Stock 2021 - 1.3.accdb
    3.4 MB · Views: 75

Gasman

Enthusiastic Amateur
Local time
Today, 06:07
Joined
Sep 21, 2011
Messages
14,238
Right, I cannot see the form completely as the subformcontrol is blank. I get an error about needing a later version.

However in design mode I can see the form, and you have now placed that form inside the subform with another subform control.
That subform control is called Child77 and it's source object is qryActualQty (which is actually a form :mad: ) and there is also a query of the same name. Bearing in mind your experience in Access, you had better start using better naming comventions, else you are going to get confused as hell, as well as initially confusing anyone trying to help you, like me for instance? :(

I would have named that form frmActualQty whose source is qryActualQty. I know Access tends to offer the same name, but get out of that habit, or it will come back to bite you.

So, you need to refer to that control (which is actually another level down now) to get the value in you control.
So repeat the syntax. Remember however it is the subformcontrol name you use

I am going to let you have a go and post back the syntax of what you have. You will learn so much more that way, than just me giving you the syntax. I cannot even test my syntax as I do not see all the objects.

BTW the control name is not even correct, it is called txtSumOfActualQty ! :(
Also the DB uploaded does not match your picture of frmMain?

Have a go and come back with what you have.
Edit: See here for control referencing on multiple forms/subforms http://access.mvps.org/access/forms/frm0031.htm
 

Users who are viewing this thread

Top Bottom