Input zip code; get city, state, county with MapPoint

  • Thread starter Thread starter Edward P Sager
  • Start date Start date
E

Edward P Sager

Hello,

I am looking to have a form in my Access database which, when I type in the
zip code, the city, state and county will be completed automatically. I
have MapPoint 2002 in addition to Access 2002.

Any ideas on how this might be done?

Thank you,
edsager
 
Hi,


I didn't know we could do that :-), but, indeed, we can (through the
User Interface, at least).


First, you need a reference to MapPoint, in your References..., since we
will use Automation.


Next, we need to "find" the location, and from it, its StreetAddress:

==================

Dim objApp As New MapPoint.Application
Dim objMap As MapPoint.Map
Dim objLoc As MapPoint.Location


'Set up the application
Set objMap = objApp.ActiveMap
objApp.Visible = True
objApp.UserControl = True


'Find an address
Set objLoc = oMap.FindAddressResults( , , , "H2Y 3B3",
geoCountryCanada)(1)

'Return the city string of this address
MsgBox "City: " + objLoc.StreetAddress.City ' Should display Montreal

==================


(untested, made of few cut and paste from the Map Point Help File). Note
that you may decide to not open a new MapPoint.Application each time, and
decide it may be preferable to not get it "visible".



Hoping it may help,
Vanderghast, Access MVP
 
I am looking to have a form in my Access database which, when I type in the
zip code, the city, state and county will be completed automatically. I
have MapPoint 2002 in addition to Access 2002.

Hi,

You should be able to do this easily in Access without the overhead of
calling MapPoint.. there are a number of vendors who will sell you a
more up-to-date lis of zip codes with city, state, county, etc.
relatively cheap.

Search on Google for "zip code list", "zip code database" and check
out the ads. You can also try MelissaData.com, GreatData.com,
Geographic.com etc.

Note there are a number of nifty article on integrating Access and
MapPoint as well as performing geocoding at:
http://www.mp2kmag.com/articles.asp

Eric

New MP2Kmag Newsletter - Mapping Earthquake Data, Getting
Started with Excel, MapPoint Programming Challenge, more -
http://www.mp2kmag.com/update/mappoint.newsletter/2004-09-30/
 
Back
Top