0

I have been successfully using code such as:

Forms![MyForm]!Option1 = False

However, I now wish to make the above dynamic by using N = 1,2,3,4 etc. So the new code would look something like:

Forms![MyForm]!Option & N = True

Does anyone have any hints about how to make this work?

Many thanks.

1 Answer 1

1

You want to avoid using bang notation !. Instead, use fully qualified references like this:

Forms.Item("MyForm").Controls.Item("Option" & N).Value = True

If you want to know more about bang notation there are SO threads like this one about it: Bang Notation and Dot Notation in VBA and MS-Access

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.