object reference issue when trying to fill text boxes

engineersmnky

New member
Joined
Jun 27, 2011
Messages
1
Programming Experience
1-3
I have a query that returns data which is stored into a set of arrays. The first array holds the name of the box to fill and the second holds the information to fill by Tiers.
(i.e. boxname array will hold the full set of boxes in this case 12 strings, the second array can hold multiple sets of data to fill these fields in this case 36 values 3 Tiers).
I am trying to allow these boxes to fill from the set of arrays using the following but continue to get issues regarding object reference not set. I know that I have called controls by looping through an array in vba but this is my first large scale vb.net project and I cannot seem to work it out.

<code>
Public boxname(50) As String
Public Book(100) As String
..... ' Fill the arrays and Resize correctly
'tbaIndex tells the second array which set of data to retrieve
Dim v As Integer
v = tbaIndx
For r As Integer = 0 To boxname.Length - 1
Me.Controls(boxname(r).ToString).Text = ScrubString(Book(boxname.Length * v + r))
Next r
</Code>

***SOLVED the method I was using to call the second array caused issues referencing the controls because it was loading non date into date fields.

Thank you anyway for anyone that took the time to read my issue
 
Last edited:
Back
Top