Validate Address String

pgrooms
11-06-2002, 10:56 AM
Using Mappoint 2002 and VB 6.0 I have created a simple program to provide drivers with a route when they select a customer from an Access database. Everything works great as long as the address info is valid. How can I validate the address information in Mappoint and let Mappoint decide if it can route using the address info. :!:

Anonymous
11-07-2002, 04:30 AM
you have to validate address before sending it.


you can use FindAddressResults method of map object of Mp2k2

object.FindAddressResults([Street], [City], [OtherCity], [Region], [PostalCode], [Country])

the function will return results. Then you will control if the address exists is. if not exists. then you must say to user to correct the address. MAybe you can give correct address. OR you can return to user the postal code that is missed. Just think abut it.

Hope it helps.

example pasted from microsoft reference:

Sub FindAddressSearch()
Dim objApp As New MapPoint.Application
Dim objFindResults As MapPoint.FindResults

'Set up application
objApp.Visible = True
objApp.UserControl = True

'Output first result of find search
Set objFindResults = objApp.ActiveMap.FindAddressResults("One Microsoft Way", "Redmond", , "WA", , geoCountryUnitedStates)
MsgBox "The first item in the find list is: " _
+ objFindResults.Item(1).Name

End Sub

 
Web mp2kmag.com
mapforums.com