VARIABLE SUBSTITUTION

  • Thread starter Thread starter Robert Lowe
  • Start date Start date
R

Robert Lowe

Hi,
I have a form with 24 checkboxes. (CheckBox1...CheckBox24)
Is there a way to make the following work?
This works...
If CheckBox3 Then MsgBox "Three"
This doesn't...
i = 3
z = "CheckBox" & LTrim(Str(i))
If z Then MsgBox "Three"

Thank you
 
If the Checkboxes are in a userform, try this:

z = Me.Controls("CheckBox" & i).Object .Value
 
Robert,

This is how you do it

If Me.Controls("Checkbox" & i).Value = True Then
MsgBox "Found"
End If


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Thank a lot...
It works great. I would never have gotten it!
I have MUCH to learn....
Robert
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top