Referencing image names with variables
Here's the situation. And I'm sure it's something that I'm just overlooking.
Say I've got images with names image1....image10 and they have tags 20....30.
I've actually got a couple hundred and want to rename them like this.
dim i
for i = 1 to 10
image & i.name = image & i.tag
next i
obviously this doesn't work. I can't get the variable attached to the image in a what that I can bring up the name property.
Any ideas? PS: This is in VBA.
This thread can be closed
Thanks for all your help guys and gals. It turned out I didn't need to rename all the image files. I switched tactics:
Code:
Public myimage As Image
Public imageflag As Boolean
Public imagefile As String
Public Sub Imageclick(num As Image)
Set myimage = num
imageflag = True
End Sub
Private Sub Form_Timer()
Static intShowPicture As Integer
If imageflag = True Then
If intShowPicture Then
myimage.Visible = True
Else
myimage.Visible = False
End If
intShowPicture = Not intShowPicture
End If
End Sub