Results 1 to 2 of 2
  1. #1
    yeah is offline Advanced Beginner
    Windows XP Access 2000
    Join Date
    Nov 2010
    Posts
    61

    Array will not ReDim...

    If I'm missing something, pls lemme know...

    intIndex = 1
    Dim MyArray() As Variant
    ReDim MyArray(1 To 1, 1 To 2)
    intIndex = intIndex + 1
    ReDim Preserve MyArray(1 To intIndex, 1 To 2)

    Last line fails with error #9 - subscript out-a-range
    All I'm trying to do is ReDim MyArray(1 To 2, 1 To 2) from its previous setting of (1 To 1, 1 To 2). Shouldn't it be possible to do this?

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    The syntax is [lower To] upper [,[lower To] upper]
    ...so try ReDim Preserve MyArray( intIndex, 1 To 2)
    ...remembering that unless you change it the base is 0.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Static Array Issue
    By Tinarad in forum Programming
    Replies: 1
    Last Post: 03-01-2011, 01:14 PM
  2. Load SQL results into an array
    By Tyork in forum Programming
    Replies: 8
    Last Post: 01-24-2011, 01:58 PM
  3. can i put the result in array?
    By dada in forum Programming
    Replies: 1
    Last Post: 08-19-2010, 07:17 PM
  4. Building Array
    By jgelpi16 in forum Forms
    Replies: 12
    Last Post: 03-22-2010, 12:33 PM
  5. How to use array? [ solved] Thanks.
    By wasim_sono in forum Programming
    Replies: 0
    Last Post: 10-20-2006, 12:00 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums