Justin
If I understand properly, it seems that you might be hitting this branch
You can put a break-point to confirm.Code:' is New question If q = Empty Then If MapForm.StudentAnsLBL.Caption = Label1.Caption Then li.SubItems(rr) = aaQList(rr) ' Qlist End If ' has been Asked Else b = b End If
If that is so, then you've hit the spot that I did not know what you wanted to do
In your post #18, you had the equivalent line commented out
.. so I left that branch unfinished as I assumed that you had a plan in mind.Code:Dim lIndex As Long If QList.ListCount Then lIndex = Int(Rnd * QList.ListCount) QuestionLBL.Caption = QList.List(lIndex) ' QList.RemoveItem lIndex End If
If you still have an issue with that, describe what you want to do, and I'll take a look.
Actually, now that I look at it further, maybe just moving the Exit For statement will do the trick
The loop will still be exited if it is a new question.Code:With Lvwbook ' Post Answer For ii = 1 To .ListItems.Count b = .ListItems.Item(ii) If b = MapForm.StudentPickLBL.Caption Then ' StudentPickLBL Set li = Lvwbook.ListItems.Item(ii) ' generate random question rr = Int(Rnd * 14) ' preset to 13 rr = IIf(rr = 0, 1, rr) ' trap for 0 q = li.SubItems(rr) Label1.Caption = aaQList(rr) ' put in cyan label ' is New question If q = Empty Then If MapForm.StudentAnsLBL.Caption = Label1.Caption Then li.SubItems(rr) = aaQList(rr) ' Qlist Exit For End If ' has been Asked Else b = b End If End If Next ii End With
But, if the line b = b is encountered, the Loop will continue, generating another random question.
Let me know if that does the trick.
EDIT-1.
Oops, something just occurred to me.
There is the distinct possibility that you will encounter an endless-loop !!
Let me tinker with this a bit .. I have a potential solution in mind.
Spoo




Reply With Quote