dynamic array question???

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Marc

    #1

    dynamic array question???

    Hi the below code works fine.

    however as i wont always know that the objloc array has 4
    parameters...ho w can i modify this code so that the array is dynamic??

    Sub MapSelectedProp erties()
    Dim objLoc2(1 to 4) As MapPoint.Locati on
    Dim i As Integer
    i = 0
    Set Recordset = CurrentDb.OpenR ecordset("SELEC T * FROM
    tblProperties;" )
    If Recordset.Recor dCount 0 Then
    While Not Recordset.EOF
    i = i + 1
    Set objLoc2(i) =
    objMap.FindAddr essResults(Reco rdset!strStreet , Recordset!strCi ty,
    Recordset!strSt ate, Recordset!strPo stalCode)(1)
    Set objPin = objMap.AddPushp in(objLoc2(i), Recordset!strSt reet)
    Recordset.MoveN ext
    Wend
    End If
    ' objMap.Shapes.A ddPolyline objLoc2

  • tommaso.gastaldi@uniroma1.it

    #2
    Re: dynamic array question???

    Hi marc,

    you could use for instance

    dim objLoc2 as New arraylist

    dim objLoc2 as New List(Of MapPoint.Locati on)
    [Imports System.Collecti ons.Generic]

    or similar
    ....


    Marc ha scritto:
    Hi the below code works fine.
    >
    however as i wont always know that the objloc array has 4
    parameters...ho w can i modify this code so that the array is dynamic??
    >
    Sub MapSelectedProp erties()
    Dim objLoc2(1 to 4) As MapPoint.Locati on
    Dim i As Integer
    i = 0
    Set Recordset = CurrentDb.OpenR ecordset("SELEC T * FROM
    tblProperties;" )
    If Recordset.Recor dCount 0 Then
    While Not Recordset.EOF
    i = i + 1
    Set objLoc2(i) =
    objMap.FindAddr essResults(Reco rdset!strStreet , Recordset!strCi ty,
    Recordset!strSt ate, Recordset!strPo stalCode)(1)
    Set objPin = objMap.AddPushp in(objLoc2(i), Recordset!strSt reet)
    Recordset.MoveN ext
    Wend
    End If
    ' objMap.Shapes.A ddPolyline objLoc2

    Comment

    • Marc

      #3
      Re: dynamic array question???

      thanks tommaso,

      ive think im in the wrong forum....this is all access vba..i dont think
      it suppports array lists?


      tommaso.gastald i@uniroma1.it wrote:
      Hi marc,
      >
      you could use for instance
      >
      dim objLoc2 as New arraylist
      >
      dim objLoc2 as New List(Of MapPoint.Locati on)
      [Imports System.Collecti ons.Generic]
      >
      or similar
      ...
      >
      >
      Marc ha scritto:
      >
      Hi the below code works fine.

      however as i wont always know that the objloc array has 4
      parameters...ho w can i modify this code so that the array is dynamic??

      Sub MapSelectedProp erties()
      Dim objLoc2(1 to 4) As MapPoint.Locati on
      Dim i As Integer
      i = 0
      Set Recordset = CurrentDb.OpenR ecordset("SELEC T * FROM
      tblProperties;" )
      If Recordset.Recor dCount 0 Then
      While Not Recordset.EOF
      i = i + 1
      Set objLoc2(i) =
      objMap.FindAddr essResults(Reco rdset!strStreet , Recordset!strCi ty,
      Recordset!strSt ate, Recordset!strPo stalCode)(1)
      Set objPin = objMap.AddPushp in(objLoc2(i), Recordset!strSt reet)
      Recordset.MoveN ext
      Wend
      End If
      ' objMap.Shapes.A ddPolyline objLoc2

      Comment

      Working...