|
-
Nov 19th, 2002, 12:05 AM
#1
Thread Starter
Junior Member
Labels inside Loop - correct syntax? _ RESOLVED
I need some help with the correct syntax.
I have a form with ten labels, lbl1 - lbl10.
I need to get ten records from a database and display each record in a label. I'm not sure of the correct way to do this.
Thanks
- - - - - -
for i = 1 to 10
Lbl "(i)" = rs("word")
if not recordsetObject.EOF then
RecordsetObject.movenext
Else
Exit For
End if
Next
Last edited by pounce; Nov 19th, 2002 at 12:19 AM.
-
Nov 19th, 2002, 12:10 AM
#2
Hyperactive Member
You need to create an array of labels. To do this simply set the index property of lbl1 to 0 and copy paste it ten times. then inside your code use:
VB Code:
for i = 1 to 10
Lbl1(i-1).Caption = rs("word")
...
-
Nov 19th, 2002, 12:18 AM
#3
Thread Starter
Junior Member
Thanks!
I give you all my points!
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
|