Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VBA Multiple Objects with 'With' Statement

I have a check box that when checked multiple boxes are disabled on my form. Currently im using

With Me!Textbox
.Locked = True

Is there a method where I can list multiple objects within the With statement rather than writing out each time for every textbox

e.g.

With Me!Text1, Text2, Text3
like image 231
InvalidSyntax Avatar asked May 18 '26 17:05

InvalidSyntax


1 Answers

It may be easiest to add something to the tag property to identify the relevant controls, "lock", say. Then you can iterate over the controls collection and lock anything with a tag set to "lock".

like image 107
Fionnuala Avatar answered May 21 '26 00:05

Fionnuala



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!