
Originally Posted by
Belleye
Thanks for your reply, correct me if I'm wrong but the above code references the buttons by which order they where created in? I was hoping to reference the buttons by name, is this possible?
You can use the Controls collection to address a control direcly by name as well...
Code:
X = 2
Me.Controls("CommandButton" & X).BackColor = vbRed
So X could be the variable used as a For..Next loop counter as you seem to want.
Bookmarks