Working with Variable

  • Thread starter Thread starter Victor Torres
  • Start date Start date
V

Victor Torres

Well, I know that this statement is very wrong. I need to see how can I
make it work. Thanks

Dim Buttonexe1 As String
Dim Numbutton As Long

Numbutton = 1

Buttonexe1 = "Me.Button" & Numbutton & ".Picture"

Buttonexe1 = "C:\Program Files\Cyber Hospicio\Flat Button2.png"
 
Victor Torres said:
Well, I know that this statement is very wrong. I need to see how can I
make it work. Thanks

Dim Buttonexe1 As String
Dim Numbutton As Long

Numbutton = 1

Buttonexe1 = "Me.Button" & Numbutton & ".Picture"

Buttonexe1 = "C:\Program Files\Cyber Hospicio\Flat Button2.png"


It would be easier if you had also explained what you were trying to do with
your code. However, I *think* this is what you're after:

NumButton = 1

Me.Controls("Button" & NumButton).Picture = _
"C:\Program Files\Cyber Hospicio\Flat Button2.png"
 
Thanks that is exactly what I need. It works great.

P.S. I am creating a very nice Switchboard with custom hover buttons and
round edge. Very similar to the menu in the antivirus AVG. This was the
last code that I need. Thanks again.
 
Back
Top