Solved Form does not display total value (1 Viewer)

sbaud2003

Member
Local time
Today, 09:49
Joined
Apr 5, 2020
Messages
178
I have a form in continuous view. In the detail section I have records where amount filed is need to be enter in the text box TXTAMT.
I have a text box TXTTOTAL in the header section where it should shows the sum total as i enter the amount in each records.
code i used TXTTOTAL=sum([TXTAMT]) but it display only first one or two records total after that it becomes blank.
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 21:19
Joined
Oct 29, 2018
Messages
21,477
Hi. Just a guess but make sure there are no Null values in the TXTAMT field.
 

Ranman256

Well-known member
Local time
Today, 00:19
Joined
Apr 9, 2015
Messages
4,337
summing Nulls gives nulls.

use: Nz([field],0)
to convert the null to zero.
 

sbaud2003

Member
Local time
Today, 09:49
Joined
Apr 5, 2020
Messages
178
Next step for me then is to physically look at it. Are you able to post a sample db with test data?
thanks.... the sum get displayed sum time but late display... i.e update does not takes place immediately.
 

Shananarocks

New member
Local time
Today, 12:19
Joined
Feb 25, 2020
Messages
4
I have a form in continuous view. In the detail section I have records where amount filed is need to be enter in the text box TXTAMT.
I have a text box TXTTOTAL in the header section where it should shows the sum total as i enter the amount in each records.
code i used TXTTOTAL=sum([TXTAMT]) but it display only first one or two records total after that it becomes blank.

Hi, you can only use sum([TXTAMT]) in a report format assuming the TXTAMT points to a data control source.
For a "Form" format, you can use DSUM function which should be as follows:
TXTTOTAL= DSUM("[TXTAMT]", "tbl_Name or Qry_Name") ' Note that invert comma positions. Also no criteria required for this query

Cheers! Mikey
 

sbaud2003

Member
Local time
Today, 09:49
Joined
Apr 5, 2020
Messages
178
Hi, you can only use sum([TXTAMT]) in a report format assuming the TXTAMT points to a data control source.
For a "Form" format, you can use DSUM function which should be as follows:
TXTTOTAL= DSUM("[TXTAMT]", "tbl_Name or Qry_Name") ' Note that invert comma positions. Also no criteria required for this query

Cheers! Mikey
Thnaks Shan ...with DSum its working fine
 

Users who are viewing this thread

Top Bottom