Quick way to get all control names in a form ??

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there any quick way to see all the control names on a form so I know what names to refer to in my VBA code, rather than going into 'properties' for each one?
 
David said:
Is there any quick way to see all the control names on a form so I
know what names to refer to in my VBA code, rather than going into
'properties' for each one?

If the form is open in design view, the "object box" at the left-hand
end of the form design toolbar contains a dropdown list of all objects
on the form. Or, for a quick list, open the form, whether in design
view or otherwise, then press Ctrl+G to open the Immediate window, and
type the line of code below into that window and press Enter:

for each c in Forms!YourFormName : ?c.name : next c

(substitute your form's name for "YourFormName" in the above line.)
 

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

Back
Top