chrisjames25
Registered User.
- Local time
- Today, 04:45
- Joined
- Dec 1, 2014
- Messages
- 404
Hi. Its been a while!!!!!
I have multiple forms in my database. Overtime i may choose to change the color scheme or alternatively just to save me choosing colors for command buttons when building forms i'm looking for a way of setting the command buttons backcolor and forecolor on the load event of a form.
I found the following code on a thread here which got me 90% of way:
To get me the final 10% of way i'd love to know how i could actually now define the wanted color as an rgb statement RGB(117,117,117) as a public constant in a module. This would then allow me to quickly amend all forms if i referenced this constant in each load event of each form.
I defined a constant as follows:
however when i tweaked the above code to this:
i get an error message. Any help much appreciated. Alternatively if there is a different way to do this im open to ideas.
I have multiple forms in my database. Overtime i may choose to change the color scheme or alternatively just to save me choosing colors for command buttons when building forms i'm looking for a way of setting the command buttons backcolor and forecolor on the load event of a form.
I found the following code on a thread here which got me 90% of way:
Code:
Dim ctl as Control
For each ctl in Me.Controls
If ctl.Tag ="C" Then ctl.Forecolor = vbBlue
Next
To get me the final 10% of way i'd love to know how i could actually now define the wanted color as an rgb statement RGB(117,117,117) as a public constant in a module. This would then allow me to quickly amend all forms if i referenced this constant in each load event of each form.
I defined a constant as follows:
Code:
Public Const SC As String = "RGB(203, 203, 203)"
however when i tweaked the above code to this:
Code:
Dim ctl As Control
For Each ctl In Me.Controls
If ctl.Tag = "C" Then ctl.ForeColor = SC
Next
i get an error message. Any help much appreciated. Alternatively if there is a different way to do this im open to ideas.