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)
Monday:(textboxes)
Tuesday:(textboxes)
Wednesday:(textboxes)
Thursday:(textboxes)
Friday:(textboxes)
Buttons are:
save week, show average, clear and exit
I really appreciate anyone's help that can help me!!!
Comments
:
: Okay I have an array of (3, 4)
: the form has a combo box with 1-4(weeks)
: Monday:(textboxes)
: Tuesday:(textboxes)
: Wednesday:(textboxes)
: Thursday:(textboxes)
: Friday:(textboxes)
:
: 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:
[code]
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)
[/code]
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.
Best Regards,
Richard
nIndex = Val(ComboBox.List(ComboBox.ListIndex)) - 1
I am using VB.net
my combo box is:
cboWeek.
when i use that code it does give me the selection for list.
what would I use??
Thanks,
Rob
: I have a question for ya. The reply you sent had this:
:
: nIndex = Val(ComboBox.List(ComboBox.ListIndex)) - 1
: I am using VB.net
:
: my combo box is:
: cboWeek.
:
: when i use that code it does give me the selection for list.
: what would I use??
:
: Thanks,
: Rob
==========================
Rob,
A hint for VB.Net
If you call any object like a comboBox by a customName then use that customName before the dot.
Eg. In your case>>
nIndex = Val(cboWeek.List(cboWeek.ListIndex)) - 1
Hope this helps? :-)
Regards,
Dr M.
What I need is when I select the combo box, I need to be able to
bring up the data that is saved.
Lets say the user has week two selected in the combo box. They want to see the data that is saved from week one. I need to have a select change for the combo box that will allow the user to see the data that is saved from the previous weeks.