Kindly_Kaela
01-04-2007, 03:05 PM
Hi Everyone!!
I'm wondering if it's possible to run a loop that will incrementally increase the number of an image, textbox, etc.
Specifically, my program displays Image 1 if X = 1, Image 2 if X = 2, Image 3 if X=3, etc. I have 90 images, so I am looking for a simple way to write this.
So far my program looks like this (only displaying 3, but it really is 90)...
Sub ImageChange_Click()
Image1.Visible = False
Image2.Visible = False
Image3.Visible = False
If variable = 1 Then
Image1.Visible = True
Image2.Visible = False
Image3.Visible = False
ElseIf variable = 2 Then
Image1.Visible = False
Image2.Visible = True
Image3.Visible = False
ElseIf variable = 3 Then
Image1.Visible = False
Image2.Visible = False
Image3.Visible = True
End If
End Sub
Thanks!
Kaela
I'm wondering if it's possible to run a loop that will incrementally increase the number of an image, textbox, etc.
Specifically, my program displays Image 1 if X = 1, Image 2 if X = 2, Image 3 if X=3, etc. I have 90 images, so I am looking for a simple way to write this.
So far my program looks like this (only displaying 3, but it really is 90)...
Sub ImageChange_Click()
Image1.Visible = False
Image2.Visible = False
Image3.Visible = False
If variable = 1 Then
Image1.Visible = True
Image2.Visible = False
Image3.Visible = False
ElseIf variable = 2 Then
Image1.Visible = False
Image2.Visible = True
Image3.Visible = False
ElseIf variable = 3 Then
Image1.Visible = False
Image2.Visible = False
Image3.Visible = True
End If
End Sub
Thanks!
Kaela