Sum of Control

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
 
J

JohnFol

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.
 
M

Mike

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
 

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