Link to home
Start Free TrialLog in
Avatar of Cimber
Cimber

asked on

Easy way to set control properties in VBA

I want to check and set properties of controls on my form in VBA Access 97.

Currently, I use a For loop to check the name of each control to find the one I want to modify. For example.
For each ctl in Me.Controls
If ctl.Name = "Name_of_Control_I'm_Looking_For" then
  .... do something
end if
next ctl

Is there a quicker and more efficient way to access a control by its name?
ASKER CERTIFIED SOLUTION
Avatar of Jorge Paulino
Jorge Paulino
Flag of Portugal image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Cimber
Cimber

ASKER

Thanks for this answer!  I am using it, to start, with just Controls("controlName").  This makes life easier than using the For Loop.