Expose Control name during loop the .controls collection of Form.

G

Guest

How is it that the name of the the control or the
control's name property can get exposed through
the .controls collection of the form object?

I want to loop through the control collection and validate
some business logic - from this point I want to know what
the name or name property of the control I am in during
loop.. Then I can use it in msgbox function or setfocus
function if the validation fails (False). Thanks for your
help.

I already know how to loop, just don't know how to expose
the name of control.

Thanks

Marcel K.

"Me.Controls.Item(indx)"
 
R

Rob

Me.Controls.Item(indx).Name is the name of the control (ie
txtLastName)
Me.Controls.Item(indx).value is what is IN the control
(Text value usually)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top