expressions - using 'sum'

G

Guest

Hi,
Is it possible to calculate the sum total of a field in a table to display
it in a form, but with an additional exception rule.

The exception rule i need to apply is that only records that share the same
value in a secodary field are calculated.

Hope this makes it a little clearer...

I have used =sum([Field2]) on the masterForm in a text field that
calculates all data in Field2.

What i want to do if it is possible is to sum Field2 on the masterForm but
only if masterForm!Field1 is equal to subForm!Field1


Any help very much appreciated...
 
G

Graham R Seach

Lee,

<<sum Field2 on the masterForm but only if masterForm!Field1 is equal to
subForm!Field1>>
DSum("[Field2]","tblMyTable", Forms!MasterForm!Field1 =
Forms!MasterForm!subForm.Form!Field1)

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
 

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