Help with Mappoint draw line code

M

Marc

Hi, the below code adds a pushpin to a mappoint map and works fine
--except for the last part which should connect the points with a
line..I believe i am calling the 'objloc' incorrectly.

Any ideas?


Sub MapSelectedProperties()
Dim db As Database
Dim rstProps As Recordset

Dim objLoc As MapPoint.Location
Dim objMap As MapPoint.Map
Dim objPushpin As MapPoint.Pushpin

Dim strMsg As String
Dim i As Integer
i = 0
Set db = CurrentDb()

'Load the selected properties into a recordset
Set rstProps = db.OpenRecordset("SELECT * FROM tblProperties WHERE
ysnSelected = Yes;")
'Make sure at least one property was selected
If rstProps.RecordCount > 0 Then
'Load Map
If LoadMap() Then
'Open the form containing the map
FormOpen "frmMap"
Set objMap = gappMP.ActiveMap
'Place a pushpin on the map for each selected property
While Not rstProps.EOF
i = i + 1
Set objLoc = objMap.FindAddressResults(rstProps!strStreet,
rstProps!strCity, rstProps!strState, rstProps!strPostalCode)(1)
Set objPushpin = objMap.AddPushpin(objLoc, rstProps!strStreet)
objPushpin.Name = CStr(i)
objPushpin.Note = "$" & rstProps!curListPrice
objPushpin.BalloonState = geoDisplayBalloon
objPushpin.Symbol = 77
objPushpin.Highlight = True
rstProps.MoveNext
Wend

-------------------------------------------------------------------------------------
Dim oShp As MapPoint.Shape
Set oShp = objMap.Shapes.AddPolyline(Array(objLoc))
oShp.Name = "test"
oShp.SizeVisible = True

---------------------------------------------------------------------------------------
 
A

Arvin Meyer [MVP]

You might want to ask this in a MapPoint newsgroup. IIRC, Location is a
member of MapPoint.Waypoint, but I am not sure since it's been several years
since I've written any Access/MapPoint automation code. Try in:

microsoft.public.mappoint
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

dynamic array help 2
dynamic array question??? 2
IF Statement 6
Array help 3

Top