473,407 Members | 2,315 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,407 software developers and data experts.

Can you refer to a group in VBA?

I want to toggle the "visible" property of a large number of fields and lables depending on certain conditions.

Instead of writing a "set visible" for each field, can I group them and set the visible property for a group?

I have not been able to find how to name or refer to a group. Maybe this is not doable?
Dec 21 '11 #1

✓ answered by NeoPa

You can't do that, but you can use a For Each X In Me.Controls construct to go through all controls in a VBA loop as long as you have something by which to identify the controls you're interested in.

2 1837
NeoPa
32,556 Expert Mod 16PB
You can't do that, but you can use a For Each X In Me.Controls construct to go through all controls in a VBA loop as long as you have something by which to identify the controls you're interested in.
Dec 22 '11 #2
NeoPa
32,556 Expert Mod 16PB
Another, less obvious, item is the .ControlType property of controls. It's not actually a property of Control itself, but it is a common property to all the built-in controls so is pretty safe to use. This way, you can check though all the controls and ignore any that aren't even the types you're looking for (EG. acTextBox is the ControlType for a Text Box control).
Jan 19 '12 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Kat | last post by:
This is a new one on me...a user wants to select a report then see a checkbox list of the "groups" to be included in the report. He wants to turn on/off whether or not to insert a page break...
16
by: ben beroukhim | last post by:
I have huge number of legacy code which use standard files functions. I would like to pass a memory pointer rather than a FILE pointer. I am trying to use FILEs in the code to refer to memory...
7
by: George Copeland | last post by:
This is a request for assistance analyzing a problem we are experiencing in our VB6 development environment. All our code is developed in VB6, and our persistance layer is SQL Server. We are...
12
by: Bill Moran | last post by:
Hey all. I've hit an SQL problem that I'm a bit mystified by. I have two different questions regarding this problem: why? and how do I work around it? The following query: SELECT GCP.id,...
5
by: jacob.dba | last post by:
I have a table with first name, last name, SSN(social security number) and other columns. I want to assign group number according to this business logic. 1. Records with equal SSN and (similar...
4
by: Ryan | last post by:
I have some custom forms that contain their own properties and I call them as such: Dim myDialog As New myDialogForm myDialog.mID = 1 ' sets the custom property mID to 1...
10
by: Bill Nguyen | last post by:
I have several textbox controls in a form,. I name them txt1, txt2, ... txt10. How dow I refer to them in a loop to get the value in text proerty of each control? For x = 1 to 10 value =...
4
by: Richard Walker | last post by:
Hi I'm trying to disable/enable a group of checkboxes using javascript, but can't work out how to refer to them. eg: <form name="selectform" action="data.php" method="post"> <input...
4
by: pkerr2003 | last post by:
I want to list all groups within my data regardless of whether they meet a certain condition - if they do not meet the condition I want to display a count of 0 for the relevant groups. Access...
4
by: john | last post by:
I have a bound textfield in my form. In the beforeupdate event of that field I want to refer to that field's value. What's the easiest way to refer to that field's value? st = MyFieldName works...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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...

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.