: how would i code a procedure for the SelectedIndexChange event of the combo box that occurs when the user selects a week number. This procedure should display the daily attendance values for the week indicated by the combo box. In other words it should display the array values for that week in the text boxes.
: Okay I have an array of (3, 4)
: the form has a combo box with 1-4(weeks)
: Buttons are:
: save week, show average, clear and exit
: I really appreciate anyone's help that can help me!!!
Put this code, or a modified version of it, in the event for the combobox:
Dim nIndex As Integer
'Get the value selected from the combobox
' for usage as an index for the array
nIndex = Val(ComboBox.List(ComboBox.ListIndex)) - 1
Text1.Text = TheArray(nIndex, 0)
Text2.Text = TheArray(nIndex, 1)
Text3.Text = TheArray(nIndex, 2)
Text4.Text = TheArray(nIndex, 3)
Text5.Text = TheArray(nIndex, 4)
This should about do it. If you put this code in the Click event of the combobox then, as soon as the user selects a value, the five textboxes will display the value of the array.
If you want the user to be able to change the array value, you should code the Change event for the textboxes to update the array.