Problem creating find routine

David Kachuck
11-05-2002, 09:23 PM
I am creating my own version of the find place name function to find my accounts. My code is copied from the sample find program except that my find string (strAccountName) comes from a separate form specially designed for that purpose. Somehow I get a "type mismatch" error on setting the objLoc:

Dim intX As Integer

strAccountName = frmSearchMap.strAccountName
Set objMap = MappointControl1.ActiveMap

Set objFindResults = objMap.FindPlaceResults(strAccountName)
frmSearchMap.lstPossibleNames.Clear
intX = 1
Do While intX <= objFindResults.Count
Set objLoc = objFindResults.Item(intX)
frmSearchMap.lstPossibleNames.AddItem objLoc.Name
intX = intX + 1
Loop

frmSearchMap.lstPossibleNames.Visible = True

frmSearchMap.Show

Perhaps someone can see my blind spot here. Any suggestions appreciated.

John Meyer
11-06-2002, 05:52 AM
Try making this change to the Do Loop.

Do While intX <= objFindResults.Count
frmSearchMap.lstPossibleNames.AddItem objFindResults.Item(intX) .Name
intX = intX + 1
Loop

 
Web mp2kmag.com
mapforums.com