Relatively new to Access 2007 and VBA programming. Hope this question makes sense.
I have a form display. I have a set of 10 labels that are column headers, labeled as Label1, Label2, etc. Depending on user inputs, I only want to display a subset of the labels.
What I would like to do is, if the user types in a 5, make Labels 1-5 visible and labels 6-10 invisible.
How can I use VBA to dynamically build a command like:
for x= 1 to 10
if x <= 5 then
value = "true"
else
value = "false"
string x = "Label" & x & ".Visible = " & value
ExecuteVBACommand x
Thanks in advance for any help.I hope this makes sense.
I have a form display. I have a set of 10 labels that are column headers, labeled as Label1, Label2, etc. Depending on user inputs, I only want to display a subset of the labels.
What I would like to do is, if the user types in a 5, make Labels 1-5 visible and labels 6-10 invisible.
How can I use VBA to dynamically build a command like:
for x= 1 to 10
if x <= 5 then
value = "true"
else
value = "false"
string x = "Label" & x & ".Visible = " & value
ExecuteVBACommand x
Thanks in advance for any help.I hope this makes sense.