I am having difficulty accessing modified data from a dynamic tab control in VB.net. In this case I have a client record with a "one-to-many" relationship to an address table. I have created code that successfully generates and populates the tabs as required. When I attempt to read the individual tabs for update to the database, the first tab read correctly. From that point on I receive an error stating that "Index -1 is out of range."
Any assistance that you can render would be most appreciated....Thank You....
Dim strArrAdrVal(11) As String
'TODO: Complete design and implementation of address UPDATE process
'Determine number of addresses present for this client
intAdrCount = tcCliAddress.TabCount
Dim i As Integer
Dim x As Integer
For i = 0 To intAdrCount
ReDim strArrAdrVal(11)
tcCliAddress.SelectedIndex = i
strArrAdrVal(0) = CLIUIDLabel1.Text
If i = 0 Then
strArrAdrVal(1) = "B"
Else
strArrAdrVal(1) = "S"
End If
strArrAdrVal(2) = "6"
x = tcCliAddress.TabPages(i).Controls.IndexOf(Street1TextBox)
strArrAdrVal(3) = tcCliAddress.TabPages(i).Controls.Item(x).ToString
x = tcCliAddress.TabPages(i).Controls.IndexOf(Street2TextBox)
strArrAdrVal(4) = tcCliAddress.TabPages(i).Controls.Item(x).ToString
x = tcCliAddress.TabPages(i).Controls.IndexOf(CityTextBox)
strArrAdrVal(5) = tcCliAddress.TabPages(i).Controls.Item(x).ToString
x = tcCliAddress.TabPages(i).Controls.IndexOf(StateTextBox)
strArrAdrVal(6) = tcCliAddress.TabPages(i).Controls.Item(x).ToString
x = tcCliAddress.TabPages(i).Controls.IndexOf(ZipMaskedTextBox)
strArrAdrVal(7) = tcCliAddress.TabPages(i).Controls.Item(x).ToString
x = tcCliAddress.TabPages(i).Controls.IndexOf(CountryComboBox)
strArrAdrVal(8) = tcCliAddress.TabPages(i).Controls.Item(x).ToString
x = tcCliAddress.TabPages(i).Controls.IndexOf(PostalTextBox)
strArrAdrVal(9) = tcCliAddress.TabPages(i).Controls.Item(x).ToString
strArrAdrVal(10) = ""
Next i