Does that sould like best practice or is there a more efficient approach?
The form has text boxes to hold the input and if stored in an array can be printed.
' module-level variables Private RowIndexInteger, ColumnIndexInteger as Integer ' zero by default Private StudentInfo(9,1) ' size is ten and holds StudentName and StudentID Private Sub AddStudentButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AddStudentButton.Click ' my idea was simply to store the text box text in position 0,0 StudentInfo(RowIndexInteger, ColumnInteger) = StudentNameTextBox.Text ' then increment the column and store the next text box text in position 0,1 StudentInfo(RowIndexInteger, ColumnInteger + 1) = StudentIDTextBox.Text ' then increment the Row and wait for next record. RowIndexInteger += 1 End Sub
*edit: Fixed closing tag. Just /code in square brackets are all you need.
Anyone ever write to an array as input is collected one record at a time?
Thanks for any advice.
This post has been edited by Martyr2: 09 December 2008 - 03:24 PM