Results 1 to 2 of 2

Thread: Dynamic array?

  1. #1
    Join Date
    Nov 2003
    New Zealand

    Arrow Unanswered: Dynamic array?

    Hi. I would like to use a dynamic array to simplify some of my code.

    How do i add to an array without using this speifying the start and end variables.

    Dim arrStr() As String ' String Array that will hold the leased options
    Dim intArr As Integer 'array location
    intArr = 1

    If Me.chkPurchased = True Then
    ReDim arrStr(1 to intArr)
    End If
    If Me.chkLeased = True Then
    intArr = intArr +1
    ReDim arrStr(1 to intArr)
    End If

    is there another way to do this in one line.

    I want the array to only be populated with the choose values from the user.(through checkboxes). Then i can use the values the moment i have lots of these if thenelse statements everywhere.....very repititive.

    Nerdy Girl

  2. #2
    Join Date
    Sep 2003
    How many checkboxes do you have? What would be better design wise is to make your string array the size of the # of checkboxes and have each checkbox assigned a specific array slot ... Otherwise you will need to associate an array slot to the checkbox that utilizes it ...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts