2d Array Rediming, Out of Bounds?
im trying to create an address book program that stores people's names and info. i have a 2d array. but the 2nd time i redim it, i get an out of bounds error. I dont know what's wrong. Here's the code:
General/Declerations:
Code:
Dim Adrs() As String '2d array to store name and info
Dim AdrC As Integer 'stores the number of people in the array
Adds name & info array:
Code:
Private Sub Command1_Click()
ReDim Preserve Adrs(AdrC, 11)
Adrs(AdrC, 0) = AName.Text
Adrs(AdrC, 1) = Address.Text
Adrs(AdrC, 2) = City.Text
Adrs(AdrC, 3) = State.Text
Adrs(AdrC, 4) = Zip.Text
Adrs(AdrC, 5) = Country.Text
Adrs(AdrC, 6) = Phone.Text
Adrs(AdrC, 7) = Work.Text
Adrs(AdrC, 8) = Cell.Text
Adrs(AdrC, 9) = Fax.Text
Adrs(AdrC, 10) = Pager.Text
AddrList.AddItem AName.Text
AdrC = AdrC + 1
'Clears TextBoxes
AName.Text = ""
Address.Text = ""
City.Text = ""
State.Text = ""
Zip.Text = ""
Country.Text = ""
Phone.Text = ""
Work.Text = ""
Cell.Text = ""
Fax.Text = ""
Pager.Text = ""
End Sub
THANKS