DSum of the DSum

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello!
I have:
A MainForm based in T_Main
A SubForm based in T_Main too.
In SubForm I have a Textbox with

=DSum("[Area]";"T_Another";"[IdSector] = [txtIdSector]")

in Control Source row, where calc values based in T_Another.
Work fine all.

Now, I would like sum [txtIdSector] based in same T_Another or in obtained
values in this SubForm.
Where is it possible, please.
Tanks in advance.
an
 
Dear "an".

an said:
Hello!
I have:
A MainForm based in T_Main
A SubForm based in T_Main too.
In SubForm I have a Textbox with

=DSum("[Area]";"T_Another";"[IdSector] = [txtIdSector]")

in Control Source row, where calc values based in T_Another.
Work fine all.

Now, I would like sum [txtIdSector] based in same T_Another or in obtained
values in this SubForm.
Where is it possible, please.
Tanks in advance.

What is txtIdSector? A control in the subform?
I'd rather use a textbox in the footer of the subform containing
=Sum([Area])
and the same in the footer of the main form.
Or what about DSum("[Area]";"T_Another")?
Remark: You can not use an aggregate function in the footer of a form that
uses textboxes with caclulated values. Instead, you must use the calculation
expression based on fields contained in the recordsource of the form.
 
WK, thanks for your reply.

Problem solved with
=DSum("[Area]";"T_Another";"[IdSector]")
Work fine.
(txtIdSector is the Name of Textbox of the Area field in SubForm)

Many thanks ore more time.
an

Wolfgang Kais said:
Dear "an".

an said:
Hello!
I have:
A MainForm based in T_Main
A SubForm based in T_Main too.
In SubForm I have a Textbox with

=DSum("[Area]";"T_Another";"[IdSector] = [txtIdSector]")

in Control Source row, where calc values based in T_Another.
Work fine all.

Now, I would like sum [txtIdSector] based in same T_Another or in obtained
values in this SubForm.
Where is it possible, please.
Tanks in advance.

What is txtIdSector? A control in the subform?
I'd rather use a textbox in the footer of the subform containing
=Sum([Area])
and the same in the footer of the main form.
Or what about DSum("[Area]";"T_Another")?
Remark: You can not use an aggregate function in the footer of a form that
uses textboxes with caclulated values. Instead, you must use the calculation
expression based on fields contained in the recordsource of the form.
 
Back
Top