Re-Posting - How can I (if Possible) formulate data in the manner.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello all,

I posted this question a while back and got no response. so I will try again.

I have a table that has the following fields;

delDate,Date/Time
Rte,text,4
custID,text,6
StopNumber,numeric,3
latitude,numeric,9
longitude, numeric,8

I have a formula that I will be using that will give me the distances from
one stop to anotherbut since this is not excel and I cannot tell it to look
at a particular cell, i need a method that I can take the first stops
lat/long and the seconds stops lat/long and run my formula, then the second
to the third etc.

I will be using it for forms and reports once I know how to do this.

Please any help with this is greatly appreciated.
 
As you will be using it in multiple places, I would suggest you put the logic
in a function in a standard module so it can be found from anywhere.
You will need to create a query that will put your records in the order of
the stops so when you look at the first record and capture the values, you
can move to the next stop to get the values from the next record to do the
calculation.

Whatever data you need to tell it which stop to start with you should pass
to the function. The function should then return the distances between the
two stops.

So to put the steps in order:

1. Create a recordset using a query that will return the stops in order.
2. Open the recordset. (It should be positioned on the first stop to use)
3. Capture the data you need for the from part of the calculation in variables
4. Move to the next record in the recordset.
5. Capture the data you need for the from part of the calculation in variables
6. Perform the calculations
7. Close the recordset
8. Return the results of the calculation
 
Back
Top