Issue with SUM on continuous form

MarRyb

New member
Local time
Tomorrow, 05:02
Joined
Dec 2, 2015
Messages
10
Hi there,

I'm new in MS Access and I know the golden rule about searching for an answer prior creating a post, but I could not find anything helpful.

My problem is as follows.

I have 2 tables ComponentsT (with fields - ComponentID, comCode, comName and comPrice) and ComponentListT (with fields – ComListID, ComponentID and comlistQty), with two forms ComponentsF (Single Form) and ComponentsListF (Continuous Form).

My goal is to have list of components on that continuous form where I want to calculate comPrice*comlistQty in unbound textbox (txtTotalCompPrice) for each row. This works, I am using =[txtComponentPrice]*[comlistQty] (where txtComponentPrice is textbox taking its value from combobox – contro source is set to =[ComponentID].[column](3)).

However, when I try to calculate SUM in the cont. form footer for the textbox mentioned above I will get #Error. I am using this =Sum([txtTotalCompPrice]).

Attached is my DB file (MS Access 2013).

Thanks in advance for any help you can provide,
Martin
 

Attachments

dont sum the text box name, sum the field name.
 
dont sum the text box name, sum the field name.

That's part of the problem I found that

=Sum([ComponentListT]![comlistQty])

works for the sum of the quantity, but for the other sum you will need to make the record source of the form a query which joins the two table so that you have a field there to use in the sum. Your sum will have to be the sum of the products something like:

=Sum([ComponentsT]![comPrice]*[ComponentListT]![comlistQty])
 
Thank you very much for this. It works now.
 
Hi,

Sorry if this is too late for this reply however some new users with the same question may find it useful, best is to use DSUM when you are in a form.



Hi there,

I'm new in MS Access and I know the golden rule about searching for an answer prior creating a post, but I could not find anything helpful.

My problem is as follows.

I have 2 tables ComponentsT (with fields - ComponentID, comCode, comName and comPrice) and ComponentListT (with fields – ComListID, ComponentID and comlistQty), with two forms ComponentsF (Single Form) and ComponentsListF (Continuous Form).

My goal is to have list of components on that continuous form where I want to calculate comPrice*comlistQty in unbound textbox (txtTotalCompPrice) for each row. This works, I am using =[txtComponentPrice]*[comlistQty] (where txtComponentPrice is textbox taking its value from combobox – contro source is set to =[ComponentID].[column](3)).

However, when I try to calculate SUM in the cont. form footer for the textbox mentioned above I will get #Error. I am using this =Sum([txtTotalCompPrice]).

Attached is my DB file (MS Access 2013).

Thanks in advance for any help you can provide,
Martin
 

Users who are viewing this thread

Back
Top Bottom