User variable to get object value

S

Steven

Can you use a variable to return the vaule of an object in a form.

Example:

vCheckbox = "Me.Checkbox.12"

MsgBox vCheckbox

it gives me Me.CheckBox.12 when what I am looking for is True or False

Thank you,

Steven
 
S

Steven

Thank you for the response:

What I have is 15 checkboxes... CheckBox11 to CheckBox 25

Based on certain criteria will determine which checkbox I want the value of:

I would like to do it using the number 11 to 25 as a variable and then
creating a string for like

vCkBox = "Me.CheckBox " + vNumber
MsgBox vCkBox.Value

or something like that.

Thank you, Steven
 
D

Dave Peterson

dim iCtr as long
for ictr = 11 to 25
msgbox me.controls("Checkbox" & ictr).value
next ictr
 

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

Top