Summing total values in aform (1 Viewer)

aattas

Registered User.
Local time
Today, 02:12
Joined
Dec 24, 2014
Messages
74
Hi guys,
I know and feel that my question is soooo stupid, but unfortunately i dont get it.

I have in a sub-form a field called : Total Qty
I have 12 fields for months, JAN,FEB,MAR....... and each month field has a value 1, 3, 4
What I want is the system to add those values and record it in the total field.
I tried many ways but the total numbers in the Total Qty wont not display, its all blanks all the time.

Any suggestion? Thanks
 

namliam

The Mailman - AWF VIP
Local time
Today, 01:12
Joined
Aug 11, 2003
Messages
11,695
Months should not be columns, they should be rows as a result you wouldnt have this problem.

What you are doing is seriously flawed in design.... re-design should be a real option.

Given your problem though, You are doing probably JAN + FEB + MAR, eventually one of the fields is blank (AKA NULL).
Anything with NULL results in NULL (aka blank).

What you want/ need to do is capture the NULL values and subtitute them for ZERO (0)
NZ(JAN,0) + NZ(FEB,0) .... etc ...
Most likely will resolve your issue(s) (for now)
 

aattas

Registered User.
Local time
Today, 02:12
Joined
Dec 24, 2014
Messages
74
Months should not be columns, they should be rows as a result you wouldnt have this problem.

What you are doing is seriously flawed in design.... re-design should be a real option.

Given your problem though, You are doing probably JAN + FEB + MAR, eventually one of the fields is blank (AKA NULL).
Anything with NULL results in NULL (aka blank).

What you want/ need to do is capture the NULL values and subtitute them for ZERO (0)
NZ(JAN,0) + NZ(FEB,0) .... etc ...
Most likely will resolve your issue(s) (for now)
Dear Namliam
Thank you very much for your quick response.
I did do the NZ , it worked in the main form, but due to continuous form status, i split the the form into mainform and subform, the months are in the subform. With the same code of NZ, im getting blanks.
Pls help
 

namliam

The Mailman - AWF VIP
Local time
Today, 01:12
Joined
Aug 11, 2003
Messages
11,695
main form or subform shouldnt make a difference. Likely you skipped a NZ someplace for your subform.
 

mike60smart

Registered User.
Local time
Today, 00:12
Joined
Aug 6, 2017
Messages
1,904
Hi

Can you upload a zipped copy of the database?

We can then help you resolve the issue.
 

MajP

You've got your good things, and you've got mine.
Local time
Yesterday, 19:12
Joined
May 21, 2018
Messages
8,525
I have 12 fields for months, JAN,FEB,MAR....... and each month field has a value 1, 3, 4
What I want is the system to add those values and record it in the total field
Do you have 12 fields or 12 records? If you have 12 fields then likely you database is incorrectly designed and that expression will not work anyways. If you had to do it then the total of 12 fields is
=[field1]+[Field2].........[Field12]
But likely the first step is fixing your design. As Mike said, would need to see it.
 

onur_can

Active member
Local time
Yesterday, 16:12
Joined
Oct 4, 2015
Messages
180
What did you write in the formula for the Total Amount field ?, We still need to see the VT example.
 

namliam

The Mailman - AWF VIP
Local time
Today, 01:12
Joined
Aug 11, 2003
Messages
11,695
Do you have 12 fields or 12 records? If you have 12 fields then likely you database is incorrectly designed and that expression will not work anyways. If you had to do it then the total of 12 fields is
=[field1]+[Field2].........[Field12]
But likely the first step is fixing your design. As Mike said, would need to see it.
Thank you for essentially retyping my earlier post :)
 

Users who are viewing this thread

Top Bottom