Subform Addition

D

DS

I have a form with 2 Subforms. On each Subform in the footer there is a
field that adds up the total amount for the records in the Subform. On
the Main form there is a field that adds those fields up. This works
great. The problem is that the second Subform shows only the current
record on the first Subform, (This is working properly), but the textbox
that totals up the records on the second Subform only gives me the total
of the shown records....I need both the seen and the unseen. How would
I remedy this?
Thanks
DS
 
T

tina

i assume you're using an expression in the textbox control in the subform
footer, such as

=Sum(FieldName)

in the second subform, try using the DSum() function to include all the
records you want in the sum. if you're not familiar with DSum(), you can
read up on it in Access Help.

hth
 
D

DS

tina said:
i assume you're using an expression in the textbox control in the subform
footer, such as

=Sum(FieldName)

in the second subform, try using the DSum() function to include all the
records you want in the sum. if you're not familiar with DSum(), you can
read up on it in Access Help.

hth
Thanks, I started playing with it, I just have to get the Where Clause
correct.
DS
 
D

DS

tina said:
i assume you're using an expression in the textbox control in the subform
footer, such as

=Sum(FieldName)

in the second subform, try using the DSum() function to include all the
records you want in the sum. if you're not familiar with DSum(), you can
read up on it in Access Help.

hth



Great the DSum worked! I tried adding a Null statement ahead of it and that doesn't work though.

=nz(DSum([Mod Price],"Mods Detail",[Line ID]=Forms!Orders.[Order
Details]![Line ID]),0)

Perhaps some coding is wrong?
Thanks
DS
 
D

DebbieG

You need to insert " & after the =

=nz(DSum([Mod Price],"Mods Detail","[Line ID]= " & Forms!Orders.[Order
Details]![Line ID]),0)


| tina wrote:
|
| > i assume you're using an expression in the textbox control in the subform
| > footer, such as
| >
| > =Sum(FieldName)
| >
| > in the second subform, try using the DSum() function to include all the
| > records you want in the sum. if you're not familiar with DSum(), you can
| > read up on it in Access Help.
| >
| > hth
| >
| >
| > | >
| >>I have a form with 2 Subforms. On each Subform in the footer there is a
| >>field that adds up the total amount for the records in the Subform. On
| >>the Main form there is a field that adds those fields up. This works
| >>great. The problem is that the second Subform shows only the current
| >>record on the first Subform, (This is working properly), but the textbox
| >>that totals up the records on the second Subform only gives me the total
| >>of the shown records....I need both the seen and the unseen. How would
| >>I remedy this?
| >>Thanks
| >>DS
| > Great the DSum worked! I tried adding a Null statement ahead of it and that
doesn't work though.
|
| =nz(DSum([Mod Price],"Mods Detail",[Line ID]=Forms!Orders.[Order
| Details]![Line ID]),0)
|
| Perhaps some coding is wrong?
| Thanks
| DS
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top