DLookUp Sum Function on Cont. Frms

stevemccauley

Registered User.
Local time
Today, 20:57
Joined
Aug 8, 2001
Messages
75
I have a continuous subform that uses the DLookUp function in each of its records. In the footer of the form I would like to have the sum of these records. I used this formula, but I don't know if DLookUp can be combined with the SUM function:

=Sum(DLookUp("[FixCost]","List_Ports","[Port]=Forms!A_Main!B_Port.Form!Port"))

What could be wrong?
 
I tried the DSum function, but its only adding up the total of one record. I need it to add up all the records being displayed. I also tried this:

=Sum(DSum("[FixCost]","List_Ports","[Port]=Forms!A_Main!B_Port.Form!Port"))

I get a total of something, but it doesn't equal what it should. What shouls I try?
 
Steve,

I'm a little confused here ...
The DSUM function in your last post will return the sum of
the [FixCost] field for records where [Port] equals
Forms!A_Main!B_Port.Form!Port. There is no need to sum
it as it is already a sum.

The control Forms!A_Main!B_Port.Form!Port seems odd.

Wayne
 
Wayne,

I know I wasn't explaining it well. Here's an example of what I'm trying to do:

Main Form

Continuous SubForm

Record1: Value1(DLookUp function)
Record2: Value2(DLookUp function)
Record3: Value3(DLookUp function)

Footer: =Sum(DSum("[FixCost]","List_Ports","[Port]=Forms!MainForm!SubForm.Form!Port"))

Is this the expression I should be entering in the footer? Because when I just use the DSum alone it only calculates the current record.

Did I give you enough info?

Steve
 

Users who are viewing this thread

Back
Top Bottom