From: Jonas on
I want to use the Dsum function on a continuous subform. I want to
get a sum of a field in the subform based on a unique ID in the main
form. I know that I have the main form and the subform linked
properly. I have done this before but I can't figure out how to do it
now. Do I need to put the Dsum function in the footer of the
continuous subform? Below are my fields, tables and forms.

Main form: frmPayments
Subform: frmEnterCashBills

Main table: tblPayments
sub table: tblCashBillsEntry

I tried to use the following in the footer of the subform to see if I
could get anything but an error or a #name but I couldn't get it to
work. I have a field in the main fom that refers to the field in the
footer of the subform

=dsum("tblCashEntryBillAmount","tblCashBillsEntry","frmCashEntryUnIDfrPmts='29""
From: Ken Snell on
Yes, the control to show the sum must go in the subform's Footer section.

The syntax for your DSum expression would be this:

=DSum("tblCashEntryBillAmount","tblCashBillsEntry","frmCashEntryUnIDfrPmts='29'")


This assumes that the field you wish to sum is tblCashEntryBillAmount, the
table that contains the field is tblCashBillsEntry, the tblCashBillsEntry
table contains a field named frmCashEntryUnIDfrPmts, and the field
frmCashEntryUnIDfrPmts is a text datatype field.

If the above assumptions are incorrect, please provide revised information.
--

Ken Snell
http://www.accessmvp.com/KDSnell/





"Jonas" <sundet(a)yahoo.com> wrote in message
news:2fd67ca8-fa9e-4618-8948-9c8491140c30(a)q16g2000yqq.googlegroups.com...
>I want to use the Dsum function on a continuous subform. I want to
> get a sum of a field in the subform based on a unique ID in the main
> form. I know that I have the main form and the subform linked
> properly. I have done this before but I can't figure out how to do it
> now. Do I need to put the Dsum function in the footer of the
> continuous subform? Below are my fields, tables and forms.
>
> Main form: frmPayments
> Subform: frmEnterCashBills
>
> Main table: tblPayments
> sub table: tblCashBillsEntry
>
> I tried to use the following in the footer of the subform to see if I
> could get anything but an error or a #name but I couldn't get it to
> work. I have a field in the main fom that refers to the field in the
> footer of the subform
>
> =dsum("tblCashEntryBillAmount","tblCashBillsEntry","frmCashEntryUnIDfrPmts='29""


From: Jonas on
On Mar 14, 12:29 pm, "Ken Snell" <kthsneisll...(a)ncoomcastt.renaetl>
wrote:
> Yes, the control to show the sum must go in the subform's Footer section.
>
> The syntax for your DSum expression would be this:
>
> =DSum("tblCashEntryBillAmount","tblCashBillsEntry","frmCashEntryUnIDfrPmts=­'29'")
>
> This assumes that the field you wish to sum is tblCashEntryBillAmount, the
> table that contains the field is tblCashBillsEntry, the tblCashBillsEntry
> table contains a field named frmCashEntryUnIDfrPmts, and the field
> frmCashEntryUnIDfrPmts is a text datatype field.
>
> If the above assumptions are incorrect, please provide revised information.
> --
>
>         Ken Snellhttp://www.accessmvp.com/KDSnell/
>
> "Jonas" <sun...(a)yahoo.com> wrote in message
>
> news:2fd67ca8-fa9e-4618-8948-9c8491140c30(a)q16g2000yqq.googlegroups.com...
>
>
>
> >I want to use the Dsum function on a continuous subform.  I want to
> > get a sum of a field in the subform based on a unique ID in the main
> > form.  I know that I have the main form and the subform linked
> > properly.  I have done this before but I can't figure out how to do it
> > now.  Do I need to put the Dsum function in the footer of the
> > continuous subform?  Below are my fields, tables and forms.
>
> > Main form: frmPayments
> > Subform: frmEnterCashBills
>
> > Main table: tblPayments
> > sub table: tblCashBillsEntry
>
> > I tried to use the following in the footer of the subform to see if I
> > could get anything but an error or a #name but I couldn't get it to
> > work.  I have a field in the main fom that refers to the field in the
> > footer of the subform
>
> > =dsum("tblCashEntryBillAmount","tblCashBillsEntry","frmCashEntryUnIDfrPmts=­'29""- Hide quoted text -
>
> - Show quoted text -

That is exactly what I have. I get "#name?" in the textbox that
refers to the textbox in the footer of the subform. Do you have any
suggestions?
From: Ken Snell on
Questions:

1) What is the name of the textbox on main form that is referencing the
textbox in the subform's footer section?

2) What is the name of the subform control that holds the subform (open main
form in design view, click on top edge of subform control, open Properties,
click on Other, read Name property value)?

3) What is the name of the textbox in the subform's footer section?

--

Ken Snell
http://www.accessmvp.com/KDSnell/


"Jonas" <sundet(a)yahoo.com> wrote in message
news:e5fd979a-363c-4902-8248-569d165cd4b3(a)z4g2000yqa.googlegroups.com...
On Mar 14, 12:29 pm, "Ken Snell" <kthsneisll...(a)ncoomcastt.renaetl>
wrote:
> Yes, the control to show the sum must go in the subform's Footer section.
>
> The syntax for your DSum expression would be this:
>
> =DSum("tblCashEntryBillAmount","tblCashBillsEntry","frmCashEntryUnIDfrPmts=�'29'")
>
> This assumes that the field you wish to sum is tblCashEntryBillAmount, the
> table that contains the field is tblCashBillsEntry, the tblCashBillsEntry
> table contains a field named frmCashEntryUnIDfrPmts, and the field
> frmCashEntryUnIDfrPmts is a text datatype field.
>
> If the above assumptions are incorrect, please provide revised
> information.
> --
>
> Ken Snellhttp://www.accessmvp.com/KDSnell/
>
> "Jonas" <sun...(a)yahoo.com> wrote in message
>
> news:2fd67ca8-fa9e-4618-8948-9c8491140c30(a)q16g2000yqq.googlegroups.com...
>
>
>
> >I want to use the Dsum function on a continuous subform. I want to
> > get a sum of a field in the subform based on a unique ID in the main
> > form. I know that I have the main form and the subform linked
> > properly. I have done this before but I can't figure out how to do it
> > now. Do I need to put the Dsum function in the footer of the
> > continuous subform? Below are my fields, tables and forms.
>
> > Main form: frmPayments
> > Subform: frmEnterCashBills
>
> > Main table: tblPayments
> > sub table: tblCashBillsEntry
>
> > I tried to use the following in the footer of the subform to see if I
> > could get anything but an error or a #name but I couldn't get it to
> > work. I have a field in the main fom that refers to the field in the
> > footer of the subform
>
> > =dsum("tblCashEntryBillAmount","tblCashBillsEntry","frmCashEntryUnIDfrPmts=�'29""-
> > Hide quoted text -
>
> - Show quoted text -

That is exactly what I have. I get "#name?" in the textbox that
refers to the textbox in the footer of the subform. Do you have any
suggestions?


 | 
Pages: 1
Prev: Query not showing certain records
Next: Copying