2

I have a form which has 12 objects named sequentially: object0, object1, object2... and I would like to do something like a loop to get all the values instead of doing the same thing for each one.

Like:

self["object" + i] 

in a loop where the i is the current number

1 Answer 1

3

You can refer to Me:

Me("Object" & i)

When the code is running in the form's module. Or elsewhere:

Forms!TheFormName.Controls("Object" & i)

Or even

Forms![Some Form Name]("Object" & i).Value
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.