Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Needing a little help please

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

  • BitByBit_ThorBitByBit_Thor Posts: 2,444Member
    : 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!!!
    :

    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

  • rphillipsrphillips Posts: 9Member
    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
  • DrMartenDrMarten Posts: 748Member
    [b][red]This message was edited by DrMarten at 2006-2-25 13:1:43[/red][/b][hr]
    : 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.

  • rphillipsrphillips Posts: 9Member
    No not really.
    What I need is when I select the combo box, I need to be able to
    bring up the data that is saved.

  • rphillipsrphillips Posts: 9Member
    You have the application running.

    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.


Sign In or Register to comment.