473,414 Members | 1,618 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

List All Controls on an Open Form including other Containers

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
3 2315
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: gg | last post by:
I am getting the following compilation errors with the following program. My compiler is aCC 03.27 on HP-UX11 - #include <iostream> using namespace std; #include <list> #include <memory>...
1
by: Jozef | last post by:
Hello, I'm trying to loop through forms by doing a "For Each" in the Currentdb. I'm doing this like the following; Dim db as dao.database Dim docLoop as document Dim ctrl as control Set db...
6
by: Hamed | last post by:
Hello I have a form that containes a lot of controls including panels those contain other controls. Is there a way to simply get all contained controls either directly or indirectly through...
4
by: Henrik Dahl | last post by:
Hello! Is it possible to use Visual Studio 2005 or, secondarily, Visual Studio .NET 2003 to create ActiveX controls which may be consumed by VB 6.0 programs, i.e. dealt with on forms in the...
1
by: ncjed | last post by:
First off, my apologies if this topic has previously been covered. I am in the process of creating an A2K DB (Win XP) that will open other DBs (either on local drive, mapped drives, or UNC network...
2
by: Lysander | last post by:
I have not seen this feature documented before, so I thought I would share it with you, as I will be using it in a later article. For a combo or list box, the source data is normally a...
0
by: johnspruit | last post by:
I have a method to collect all the controls on a form, also the controls in containers on the form. It seems that some controls, like NumericUpDown also have child controls. I only want controls...
1
by: mirandacascade | last post by:
1) Module1 has the following delcaration: Public g_frmZZZ as Form Public g_txtForm2 as Variant 2) app has two forms: form1 and form2 3) a command button on form1 opens form2; it also has...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.