Results 1 to 2 of 2

Thread: item selected in listbox determines variable to fill

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2006
    Posts
    12

    item selected in listbox determines variable to fill

    I know I'm missing something simple because I've written 1st grade code my procedure is too large to compile. I have an array of 7 list boxes. Each list box contains 80 numbers which correspond to a competitor. When the competitor is selected in the list box I need to add the value in the corresponding text box to their accumulated score. (See below a small sample)
    Since I have done this 80 times for each listbox the code is too large to compile. What am I missing to shorten it?

    Sub GetUserProsecution()

    If lstMemberIDProsecution(0).Text = 1 Then intID1 = txtPCA.Text + intID1 Else
    If lstMemberIDProsecution(0).Text = 2 Then intID2 = txtPCA.Text + intID2 Else
    If lstMemberIDProsecution(0).Text = 3 Then intID3 = txtPCA.Text + intID3 Else
    If lstMemberIDProsecution(0).Text = 4 Then intID4 = txtPCA.Text + intID4 Else
    If lstMemberIDProsecution(0).Text = 5 Then intID5 = txtPCA.Text + intID5 Else
    If lstMemberIDProsecution(0).Text = 6 Then intID6 = txtPCA.Text + intID6 Else
    If lstMemberIDProsecution(0).Text = 7 Then intID7 = txtPCA.Text + intID7 Else

  2. #2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width