Sum of Control

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

How can I sum the total for this from each record in a form?

=miles(DLookUp("[LocationZIP]","Locations","[LocationID]=" &
[Forms]![Loads]![Stop
Order]!LocationID),DLookUp("[LocationZIP]","Locations","[LocationID]=" &
[Forms]![Loads]![Stop Order]!Text18))

I Tried Sum (...) but it didn't work. If you need to know Text18 is this.
=IIf([StopNumber]=1,[LocationID].Column(4),DLookUp("[LocationID]","LoadStops
","[ID]=" & [Forms]![Loads]![Stop Order]!ID & " And [StopNumber]= " &
[Forms]![Loads]![Stop Order]!StopNumber-1))

Thanks
 
Hi Mike, its not at all clear what the field or table is you are trying to
sum or what function "Miles" does

Have a look at DSum to get a field from a table not present on the form
totalled.
 
Thanks for looking Jon. I'll try it.


JohnFol said:
Hi Mike, its not at all clear what the field or table is you are trying to
sum or what function "Miles" does

Have a look at DSum to get a field from a table not present on the form
totalled.




Mike said:
How can I sum the total for this from each record in a form?

=miles(DLookUp("[LocationZIP]","Locations","[LocationID]=" &
[Forms]![Loads]![Stop
Order]!LocationID),DLookUp("[LocationZIP]","Locations","[LocationID]=" &
[Forms]![Loads]![Stop Order]!Text18))

I Tried Sum (...) but it didn't work. If you need to know Text18 is this.
=IIf([StopNumber]=1,[LocationID].Column(4),DLookUp("[LocationID]","LoadStops
","[ID]=" & [Forms]![Loads]![Stop Order]!ID & " And [StopNumber]= " &
[Forms]![Loads]![Stop Order]!StopNumber-1))

Thanks
 
Back
Top