SUM function inside textbox on the bottom of the form return #Error (1 Viewer)

amorosik

Member
Local time
Today, 14:49
Joined
Apr 18, 2020
Messages
390
I have a continuous form created with Access In the record origin there is a query that connects ACCOUNTINGMOVEMENTSTES with ACCOUNTINGMOVEMENTSROW and returns as many rows as there are accounting movement lines included in the current selection
Type recordset of the Snapshot form but I also tried Dynaset

In the body of the form all the requested lines are correctly displayed, for each line there are some fields taken from the ACCOUNTINGMOVEMENTSTES table and then some fields taken from ACCOUNTINGMOVEMENTSROW , one of these is the TAXABLE field, name of textbox is txtTaxable

A txtTotTaxable textbox in inserted in the bottom of the form, and in the control source there is a formula =Sum([TAXABLE ])

When I start the form the txtTotTaxable textbox continues to display #Error, what could it depend on?

I'm comparing it with a similar form, DocTes and DocRow, which works exactly as expected, they seem identical apart from the tables from which they draw the data, but Documents works and Accounting doesn't want to know about it
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 20:49
Joined
May 7, 2009
Messages
19,245
maybe use DSum() as controlsource of your textbox:

=Val(DSum("Taxable","querySourceOfYourForm") & "")
 

amorosik

Member
Local time
Today, 14:49
Joined
Apr 18, 2020
Messages
390
maybe use DSum() as controlsource of your textbox:

=Val(DSum("Taxable","querySourceOfYourForm") & "")

Thanks for the suggestion
But I've already tried =Val(Dsum([TAXABLE];filter)&"")
Same #Error result in txtTotTaxable
What I really don't understand is why it works on the Documents form and it doesn't work on the Accounting form, and they are practically the same, except for table and filed name
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 20:49
Joined
May 7, 2009
Messages
19,245
is Taxable column, calculated column?
 

CJ_London

Super Moderator
Staff member
Local time
Today, 13:49
Joined
Feb 19, 2013
Messages
16,614
is the data type for your Taxable field numeric or text?
 

Users who are viewing this thread

Top Bottom