Can someone direct me to the appropriate code to loop through all the controls on a form? I need to disable 6 text boxes when the click event happens on a command button.
cmdLockRecord_Click()
Dim intCounter as integer
dim ctl as control
set ctl = something here to indicate controls on a form….
‘lock these text boxes
‘txtLastName
‘txtPhone
‘txtFax
‘txtEmail
‘txtDomain
‘lock text boxes
for intCounter = 0 to some code here to indicate every control on the form…
with ctl
.back color = vbyellow
.enabled=false
end with
next intCounter
Thanks,