Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21243

[RESOLVED] Choosing which row to add an item in a listview?

$
0
0
Hello there everyone. This is sort of a follow up from a previous post, I have a listview called ResultsView, and it keeps track of student literacy stations. What I am doing now, is I have a listbox of the stations they worked at, and the prog searches to see if they did, and if they did, something happens.

I would like to change it, so if the prog finds something, it will add the item "COMPLETED" to the row in the right column. Let me show you what I am talking about.

VB Code:
  1. Public Sub CheckChoiceListStudent1()
  2. 'THIS CODE WILL CHECK TO SEE IF THE STUDENT HAS PICKED THE CHOICE YET
  3. ' IF THEY HAVE PICKED THE CHOICE, THEN IT WILL NOT BE VISIBLE
  4.  
  5.  
  6. 'CHECK FOR READ ON YOUR OWN
  7. Dim i1 As Long
  8.    
  9.     For i1 = StudentChoices(0).ListCount - 1 To 0 Step -1
  10. If InStr(1&, StudentChoices(0).List(i1), "Read On Your Own", vbTextCompare) Then
  11.         ReadToSelfBanner.Visible = False
  12.         ReadToSelfList.Visible = False
  13.         ReadSelfCountLBL.Visible = False
  14.      
  15.     End If
  16. Next
  17.  
  18.  
  19. 'CHECK FOR READ TO A CLASSMATE
  20. Dim i2 As Long
  21.    
  22.     For i2 = StudentChoices(0).ListCount - 1 To 0 Step -1
  23. If InStr(1&, StudentChoices(0).List(i2), "Read To A Classmate", vbTextCompare) Then
  24.         ReadToSomeoneBanner.Visible = False
  25.         ReadToSomeoneList.Visible = False
  26.         ReadSomeoneCountLBL.Visible = False
  27.     End If
  28. Next
  29.  
  30. 'CHECK FOR LITERACY CENTER
  31. Dim i3 As Long
  32.    
  33.     For i3 = StudentChoices(0).ListCount - 1 To 0 Step -1
  34. If InStr(1&, StudentChoices(0).List(i3), "Listening Center", vbTextCompare) Then
  35.         ListeningCenterBanner.Visible = False
  36.         ListeningCenterList.Visible = False
  37.         ListeningCenterCountLBL.Visible = False
  38.     End If
  39. Next
  40.  
  41. 'CHECK FOR WORD WORK
  42. Dim i4 As Long
  43.    
  44.     For i4 = StudentChoices(0).ListCount - 1 To 0 Step -1
  45. If InStr(1&, StudentChoices(0).List(i4), "Word Work", vbTextCompare) Then
  46.         WordWorkBanner.Visible = False
  47.         WordWorkList.Visible = False
  48.         WordWorkCountLBL.Visible = False
  49.     End If
  50. Next
  51.  
  52. 'CHECK FOR WRITING
  53. Dim i5 As Long
  54.    
  55.     For i5 = StudentChoices(0).ListCount - 1 To 0 Step -1
  56. If InStr(1&, StudentChoices(0).List(i5), "Writing", vbTextCompare) Then
  57.         WritingList.Visible = False
  58.         WritingList.Visible = False
  59.         WritingCountLBL.Visible = False
  60.     End If
  61. Next
  62.  
  63.  
  64. End Sub

As you can see. The above code will search for terms in the listbox called StudentChoices(0), and if it finds them, won't let the student do the same station over and over. But now I also want to add their stations to the ResultsView listview.
The above code is for student 1, so it will be all on the first row in the listview under the column headers, but I need to figure out how to have them item added to the same row, not just underneigh each other in a column. For example, if the prog finds the student did do the READ ON YOUR OWN activity, I would like it to add the item COMPLETED on ROW1, but in the first sub column, I can work on adding the rest later, such as adding items to the second sub column, 3rd sub column, 4th, etc, but all on the same row.

Can I do that? Can they all go on the same row?


THANKS!!!

Viewing all articles
Browse latest Browse all 21243

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>