|
-
Oct 27th, 2005, 10:34 PM
#1
Thread Starter
Lively Member
[RESOLVED] loop trouble
Why can't the variable "word" remain the value that is assigned to it by
resp(z) when a loop occurs?
For a = 1 To 10
Data1.Recordset.MoveFirst
Do
If Data1.Recordset.EOF Then Exit Do
x = Data1.Recordset.Fields("words")
Data1.Recordset.MoveNext
If Data1.Recordset.EOF Then Exit Do
y = Data1.Recordset.Fields("words")
If x = word Then ans = ans & " " & y
Loop
resp = Split(ans, " ")
Randomize Timer
z = Int(Rnd * UBound(resp))
word = resp(z)
Label1.Caption = Label1.Caption & " " & word
Next a
When next a occurs and it returns to the beginning of the for loop, the value of the variable "word" returms to what it was previously. How do I fix this?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|