Continuous form total not working (1 Viewer)

cpampas

Registered User.
Local time
Today, 09:54
Joined
Jul 23, 2012
Messages
218
Can somebody help me with something that I thought should be simple in the first place:

I have a continous form with a footer with a control "D", that sums the field debito, wich is a numeric field
=Sum([debito])

Instead of the sum of the numeric fields, the returned result is blank. I noticed that instead of summing if I just set the D control to [debito], it returns the first result in the form correctly.

I tried the following with no results :
=Sum(nz[debito]))
=Sum(cdbl([debito]))

also tried in the current event of the form :
Code:
   If Me.RecordsetClone.RecordCount = 0 Then
        Me.D.ControlSource = ""
        Me.D = 0
    Else
        Me.D.ControlSource = "=Sum([debito])"
    End If

Any thoughts on what I am doing wrong ?
 

bob fitz

AWF VIP
Local time
Today, 17:54
Joined
May 23, 2011
Messages
4,727
Does the total in the footer work if you set the Control Source of debito to = NZ([debito],0)
OR
Does the total work if you use =Sum(nz[debito],0))
 

cpampas

Registered User.
Local time
Today, 09:54
Joined
Jul 23, 2012
Messages
218
The result is the same with those two options , nothing appears, i suppose the result is empty
A few monthes ago I had this form working properly, so i guess I have changed something that Is causing this. I just cant figure out how to find it
 

theDBguy

I’m here to help
Staff member
Local time
Today, 09:54
Joined
Oct 29, 2018
Messages
21,480
Hi. I am not in front of a computer now, so could you please do a little experiment for me?

Add some room in the Detail section of your form and move the Textbox from the Footer into the Detail section. Is it still empty?

If not, scroll down to the last row and verify the Sum is correct.
 

bob fitz

AWF VIP
Local time
Today, 17:54
Joined
May 23, 2011
Messages
4,727
The result is the same with those two options , nothing appears, i suppose the result is empty
A few monthes ago I had this form working properly, so i guess I have changed something that Is causing this. I just cant figure out how to find it
Can you post a copy of the db with just the form and required tables/queries. Just a few fictitious records to illustrate the problem
 

SHANEMAC51

Active member
Local time
Today, 19:54
Joined
Jan 28, 2022
Messages
310
I have a continous form with a footer with a control "D", that sums the field debito, wich is a numeric field
=Sum([debito])
somehow I doubt that the form has a footer - it's not a report, after all

there is
1-title
2- note
in them you can put the summation of fields from the data area (for example debeto)
 

bastanu

AWF VIP
Local time
Today, 09:54
Joined
Apr 13, 2010
Messages
1,402
You have to pay attention to the brackets, please try this:
=Sum(Nz([debito]))

I tried the following with no results :
=Sum(nz[debito]))
=Sum(cdbl([debito]))
 

CJ_London

Super Moderator
Staff member
Local time
Today, 17:54
Joined
Feb 19, 2013
Messages
16,622
forms do have footers

is the field debitto a calculated field, either in the recordsource or on the form?
 

cpampas

Registered User.
Local time
Today, 09:54
Joined
Jul 23, 2012
Messages
218
Thanks for your replies:
theDBguy, I ve tried moving the control to the detail section, still empty
bobFitz, I will add a demo on my next message
 

bastanu

AWF VIP
Local time
Today, 09:54
Joined
Apr 13, 2010
Messages
1,402
As CJ_London implied if [debito] is calculated you must sum the calculation instead of trying to reference the name of the field.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 09:54
Joined
Oct 29, 2018
Messages
21,480
theDBguy, I ve tried moving the control to the detail section, still empty
That could mean there is something wrong with the expression or the data. Try filtering the form to reduce the number of records to certain categories, just to see if the Textbox eventually shows some value. Otherwise, you might consider posting a sample db with test data demonstrating the problem.
 

cpampas

Registered User.
Local time
Today, 09:54
Joined
Jul 23, 2012
Messages
218
I added a demo of the form, and the two controls (yellow color)
 

theDBguy

I’m here to help
Staff member
Local time
Today, 09:54
Joined
Oct 29, 2018
Messages
21,480
I added a demo of the form, and the two controls (yellow color)
Hi. I opened your form and the total looks correct. Where is the problem?

1646158861842.png
 

cpampas

Registered User.
Local time
Today, 09:54
Joined
Jul 23, 2012
Messages
218
hummm, that is strange !! this is what I get opening the same form
why would this happen ?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 09:54
Joined
Oct 29, 2018
Messages
21,480
hummm, that is strange !! this is what I get opening the same form
why would this happen ?
Is that an image of the form from the file you posted? Or, is that an image of your actual form from your actual database? If so, try downloading the attachment you posted earlier and show us what it looks like when you open the form in the attached file.
 

cpampas

Registered User.
Local time
Today, 09:54
Joined
Jul 23, 2012
Messages
218
This is an image of the file that I uploaded.
 

cpampas

Registered User.
Local time
Today, 09:54
Joined
Jul 23, 2012
Messages
218
the only way I can make it work is by pressing F9. is there a way to replicate F9 programaticaly?
 

Users who are viewing this thread

Top Bottom