Set property of ALL controls in SubForm? (1 Viewer)

MyTech

Access VBA
Local time
Yesterday, 22:55
Joined
Jun 10, 2010
Messages
108
When user confirms his newly created records in a SubForm, I want all the Controls in the Subform to get "Transparent Background" and their 'Font' to be 'Bold'.

Will I have to write code for every single Control, or there is a way to apply a property to ALL Controls in SubForm?
 

vbaInet

AWF VIP
Local time
Today, 03:55
Joined
Jan 22, 2010
Messages
26,374
How does a new record get "confirmed"? And what do you mean by that term?

How many controls are they?
 

MyTech

Access VBA
Local time
Yesterday, 22:55
Joined
Jun 10, 2010
Messages
108
User enters multiple records in a continuous subform bound to temporary "New Products" table.
When finished, he clicks "Continue" Button.

Now I want him to REVIEW the new products he is about to apply to permanent "Products" table.
Then he could click "Confirm" and code will append "New Products" table to "Products" table.

In REVIEW step, I disable the subform (Me!SubForm.Enabled = False).
But I also want to give it a 'review look', by setting all controls 'BackStyle' property to 'Transparent'.
Question is if I have to set every individual control's 'BackStyle' property,
(Me!SubForm.Form!Control1.BackStyle = Transparent)​
or there's a way to set the 'BackStyle' property of ALL controls in SubForm at once.
 
Last edited:

MyTech

Access VBA
Local time
Yesterday, 22:55
Joined
Jun 10, 2010
Messages
108
Hey, I got it!

For Each Control In Me!SubForm.Controls
Control.BackStyle = 0
Next
 

Users who are viewing this thread

Top Bottom