By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,294 Members | 2,681 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,294 IT Pros & Developers. It's quick & easy.

List All Controls on an Open Form including other Containers

P: n/a
Is there a way to list (through VBA code) all the controls on an open
form including subforms, tab controls and all other containers as well.

My specific issue is to find all controls with a FontSize property and
adjust it as needed.

When I use "For each ctrl in Me.controls" I dont get the subform
controls or other container controls.

I'm using labels, combos, text, tabs, datasheet/form subforms, and
anything will a font property.

TIA

Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
ce*******@yahoo.com wrote:
Is there a way to list (through VBA code) all the controls on an open
form including subforms, tab controls and all other containers as well.

My specific issue is to find all controls with a FontSize property and
adjust it as needed.

When I use "For each ctrl in Me.controls" I dont get the subform
controls or other container controls.

I'm using labels, combos, text, tabs, datasheet/form subforms, and
anything will a font property.


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

A subform control doesn't have any Font property.

To identify the control type have you used the TypeOf predicate?

If typeof ctrl is SubForm Then
' iterate thru the subform's controls
end if

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQmhULoechKqOuFEgEQJKtgCZAfdwvF4g21OyjTMUEW+WA3 369igAnAgZ
ISyDFin5ToWnTUNyvKsxGB+r
=Pjcv
-----END PGP SIGNATURE-----
Nov 13 '05 #2

P: n/a
Thanks, I'll use it.
But, is there a way to tell if a control has a property or even a
collection?

Nov 13 '05 #3

P: n/a
ce*******@yahoo.com wrote:
Thanks, I'll use it.
But, is there a way to tell if a control has a property or even a
collection?


All controls have properties. Collections are something not usually
associated w/ collections, though controls can be added to collections.
Collections can hold objects. Read the Access VBA Help on collections
(open the Debug window [Ctrl+G] and type the word collection. Be sure
the cursor is on the word then hit the F1 key. The VBA Help for that
word will appear.)
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.