Applying format to objects on report (1 Viewer)

smig

Registered User.
Local time
Today, 19:52
Joined
Nov 25, 2009
Messages
2,209
Is there any quick way to apply format (ForeColor) for all objects in a specific section on a report?

Something like:

for each Object in me.Section1 ...
....
Next Object
 

theDBguy

I’m here to help
Staff member
Local time
Today, 09:52
Joined
Oct 29, 2018
Messages
21,474
Do you need to use code? You can manually do it in Design View by selecting all the objects you want to modify at the same time and then change the property.
 

Isaac

Lifelong Learner
Local time
Today, 09:52
Joined
Mar 14, 2017
Messages
8,777
agree with dbGuy ... Access is pretty generous in allowing multi selections and then formatting or property changes, as long as the items selected all qualify for the same formatting or property
 

smig

Registered User.
Local time
Today, 19:52
Joined
Nov 25, 2009
Messages
2,209
Do you need to use code? You can manually do it in Design View by selecting all the objects you want to modify at the same time and then change the property.
Yes, i need to it by code.

It is possible to do it like this;
Me.lbl1.forecolor = selectedColor
Me.lbl2.forecolor = selectedColor
Me.lbl3.forecolor = selectedColor
...

But i prefer do it for all objects in specific section, even without knowing the objects names
 

Isaac

Lifelong Learner
Local time
Today, 09:52
Joined
Mar 14, 2017
Messages
8,777
You can loop through form controls and test if they are of type textbox (etc), and then if they are of the type you want to change, then you can apply a property like that. I am not sure if Sections have a Controls collection.
 

Users who are viewing this thread

Top Bottom