M
Marc
Guys ,
the below code is a VB project working woth mappoint. My probelm is
with the very last section of code not working ----'Set oShp =
objMap.Shapes.AddPolyline(objLoc2).
Im not sure i have setup the array objloc2 correclty???????
can anyone help?
Sub MapSelectedProperties()
'Map the selected properties
' On Error GoTo MapSelectedProperties_Err_Exit
Dim db As Database
Dim rstProps As Recordset
Dim objLoc As MapPoint.Location
Dim objLoc2() 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
LoadMap()
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)
rstProps.MoveNext
Wend
------------------------------------------------------------------------------------------------------
While Not rstProps.EOF
i = i + 1
Set objLoc2(i) = objMap.FindAddressResults(rstProps!strStreet,
rstProps!strCity, rstProps!strState, rstProps!strPostalCode)(1)
rstProps.MoveNext
Wend
Dim oShp As MapPoint.Shape
Set oShp = objMap.Shapes.AddPolyline(objLoc2)
the below code is a VB project working woth mappoint. My probelm is
with the very last section of code not working ----'Set oShp =
objMap.Shapes.AddPolyline(objLoc2).
Im not sure i have setup the array objloc2 correclty???????
can anyone help?
Sub MapSelectedProperties()
'Map the selected properties
' On Error GoTo MapSelectedProperties_Err_Exit
Dim db As Database
Dim rstProps As Recordset
Dim objLoc As MapPoint.Location
Dim objLoc2() 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
LoadMap()
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)
rstProps.MoveNext
Wend
------------------------------------------------------------------------------------------------------
While Not rstProps.EOF
i = i + 1
Set objLoc2(i) = objMap.FindAddressResults(rstProps!strStreet,
rstProps!strCity, rstProps!strState, rstProps!strPostalCode)(1)
rstProps.MoveNext
Wend
Dim oShp As MapPoint.Shape
Set oShp = objMap.Shapes.AddPolyline(objLoc2)