Mileage between two cities

SoxPats83

Registered User.
Local time
Today, 08:05
Joined
May 7, 2010
Messages
196
i am looking to create a form where the user can type in a city in one text box, and then a second city within another text box, click on a command button and calculate the distance in miles between these two locations.

i am a bit lost as to where to get started on this, and any help would be appreciated. currently what i have is a large mileage chart of all the applicable cities.
 
Oh that's a nice one.. How about GPS coordinates?

You need to define each city's GPS coordinates in a table though which might take some time. Then subtract the numbers when that button is clicked
 
Oh that's a nice one.. How about GPS coordinates?

You need to define each city's GPS coordinates in a table though which might take some time. Then subtract the numbers when that button is clicked
you think latitude and logitude may work?
 
Hmmm, sure if you want to spice things up a bit

Check out this link:
http://www.movable-type.co.uk/scripts/latlong.html

You need to use the Math from there
that may be a bit too complex for my liking. what i was shooting for was either:

A. i have a tables with City1 as a field and City2 as a field. then in field 3 i have the miles between City1 and City2. then if in the form, whatever selection is made in the City1 ComboBox, the City2 ComboBox becomes filtered to take out City1 and represents the remaining cities. then after a selection is made in City2 ComboBox, a locked disabeled text box populates with the value on the matching record with field3.

that may sound like a bit too much...
 
GPS coordinates are a bit easier if you ask me, both are doable

Question is, why would you want to show that.. you could just place a link to Google Maps and leave the rest on them
 
GPS coordinates are a bit easier if you ask me, both are doable

Question is, why would you want to show that.. you could just place a link to Google Maps and leave the rest on them
very truw. just trying to provide an offline alternative to the users
 
If you're going to be paid for that alternative then by all means go for it
 
There is a sample DB in this thread that uses the the formula suggested by G37Sam.

This method will however only give you an "As the crow flies distance" between any two points.

If you are looking for a road distance between two points, that will be a little more difficult. You may be able to do this by feeding the two points into Google Maps, Google earth or similar.
 
This thread discusses using various on line mapping solutions to show Way-points using a browser window embedded in an Access form, and may give you some ideas how to use these solutions to get road distances between two points.
 
i appreciate all of the input. but let's say i choose to simplify things... say the applicable cities are Boston, New York, Chicago, Seattle, and Los Angeles. in combobox # 1 the user selects Boston. and then combobox #2 only give you NY, Chi, Seattle, and LA for options (excluding Bos. as it was the combobox #1 selection). so after Boston is selected the user selects LA in combobox #2. then a text box nearby populates with "2,990 Miles". the db knows this number because in a table i have put in Boston in column 1, LA in column 2, and 2,990 Miles in column3.

thoughts?
 

Users who are viewing this thread

Back
Top Bottom