I asked GIS person about this. Here is a sample he shot at me.
With a little bit of Pythagoras, something like this might do the trick...
Code:
Private Sub cmdCalculateDistance_Click()
Dim x1 As Double
Dim x2 As Double
Dim y1 As Double
Dim y2 As Double
Dim h As Double
x1 = DLookup("[x-pos]", "Postal Codes", "[Postal Code] = " & cboStart)
x2 = DLookup("[x-pos]", "Postal Codes", "[Postal Code] = " & cboEnd)
y1 = DLookup("[y-pos]", "Postal Codes", "[Postal Code] = " & cboStart)
y2 = DLookup("[y-pos]", "Postal Codes", "[Postal Code] = " & cboEnd)
h = Sqr((x1 - x2) ^ 2 + (y1 - y2) ^ 2)
MsgBox "The distance between " & cboStart & " and " & cboEnd & " is " & h & " kilometers."
End Sub
this is using a form with to combo box where you select the two coordinates and it will do the calculations
Jaime E. Maccou