This is just a simple question. There are four command buttons in a control array. I want to write code for one of them that changes the same property in the same way for all of them. When I tried doing this with just a specific button (I entered the subscript) it gave me suggestions as it usually does, but when I didn't specify a subscript it only had four suggestions, none of which were properties that could be changed. How would you change the property of all of them at once?

Recommended Answers

All 4 Replies

Sorry this is not the answer you are looking for, but I am pretty sure you will need to put four lines of code, one for each button to change them.

Or use a loop ....

commented: Thanks +5

Is there any way to use a For Next combination? Possibly with a variable as the index number? I'll try it. If not, then tell me how you would use a loop.

Yeah sorry. I just realized the For Next is a loop. Lol. But yeah it works. Thanks for your help.

Yeah sorry. I just realized the For Next is a loop. Lol. But yeah it works. Thanks for your help.

Exactly what I had in mind - glad to help and to hear it has worked.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.