Changing properties of a form
Posted on 2012-08-20
I am using the code at the bottom to dynamically change certain properties of each form that is loaded, at the time of opening. The colours that are used get their values from hidden fields in Switchboard.
The problem is that I have to put this code into the open event of every form, which makes it difficult if I want to modify it. Is there a way of using a function that every form has to read which is held in one place?
For Each ctl In Me.Controls
Select Case ctl.ControlType
.BackColor = Forms![Switchboard]![control_back_colour]
.ForeColor = Forms![Switchboard]!control_fore_colour
.FontSize = Forms![Switchboard]![font_size]
Me.FormHeader.BackColor = Forms![Switchboard]![header_back_colour]
Me.Detail.BackColor = Forms![Switchboard]![detail_back_colour]
Me.FormFooter.BackColor = Forms![Switchboard]![footer_back_colour]