For To Next Loop

mrssevans

Registered User.
Local time
Today, 18:54
Joined
Nov 15, 2001
Messages
190
For-Next Loop

I have a For-Next loop that I am using to make the correct number of fields to appear. I have a textbox65 and textboxes 1 through 10. Here is my code:

for n = 1 to me.text65
me.text(n).visible=true
next n

Can someone help me fix this code please? I would be eternally greatful!
 
I changed it to
Private Sub Command80_Click()
n = 1
Do Until n = Me.Text65.Value
Me.Controls ("Text") & n.Visible = True
n = n + 1
Loop
End Sub

and that didn't work. I also took out "controls" and that didn't work either. Any other suggestions?
 
Private Sub Command80_Click()
n = 1
Do Until n = Me.Text65.Value
Me.("Text" & n).Visible = True
n = n + 1
Loop
End Sub
 

Users who are viewing this thread

Back
Top Bottom