If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
use variable in expression?
I have a form with a map of the US as a background and an image of a
star on each state. I want to change the visibility property of each image when a transparent button is clicked that's over each state (I'll need to do other things as well, but this is a start). But it seems that I can't use a variable in the expression to change this property, along the lines of: '(Where strState is the name of the image) Me.strState.Visible = True I tried writing a simple wrapper based on a suggestion I saw elsewhere in this forum: Public Function state(strState As String) state = strState End Function And using this instead: Me.state(strState).Visible = True It's clear that what I'm doing is wrong on some fundamental level, but I wonder if there actually is some way to achieve this (short of writing the expression out 50 times). |
#3
|
|||
|
|||
use variable in expression?
Me.Controls(strState).Visible = True
-- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no private e-mails, please) wrote in message ups.com... I have a form with a map of the US as a background and an image of a star on each state. I want to change the visibility property of each image when a transparent button is clicked that's over each state (I'll need to do other things as well, but this is a start). But it seems that I can't use a variable in the expression to change this property, along the lines of: '(Where strState is the name of the image) Me.strState.Visible = True I tried writing a simple wrapper based on a suggestion I saw elsewhere in this forum: Public Function state(strState As String) state = strState End Function And using this instead: Me.state(strState).Visible = True It's clear that what I'm doing is wrong on some fundamental level, but I wonder if there actually is some way to achieve this (short of writing the expression out 50 times). |
Thread Tools | |
Display Modes | |
|
|