VBA: Change the Color of an Object

=========
QUESTION
———
I need to change the color of an object from within my VBA code.

 

=========
ANSWER
———
See EXAMPLES

 

=========
EXAMPLES
———
Private Sub ReLinkTables_Click() 
 
Me.ReLinkTables.BackColor = RGB(186, 20, 25)
Me.ReLinkTables.ForeColor = Hex(FFF200)
Me.CurrentStatusLabel.Caption = "Clicked: ReLink Tables"
Me.CurrentStatusLabel.BackColor =
Me.CurrentStatusLabel.ForeColor = vbWhite

Me.CurrentStatus = _
"Opening Linked Table Manager" & vbCrLf & _
"Select All, Click OK, Logon as prompted, and click Close when finished" & vbCrLf & _
vbCrLf & _
vbCrLf & _
"=========" & vbCrLf & _
Me.CurrentStatus

RunCommand acCmdLinkedTableManager

End Sub

 

=========
APPLIES TO / KEY WORDS
———
Microsoft Access
VBA
Color
Code

 

=========
REF
———

 


http://www.anysitesupport.com/vba-change-the-color-of-an-object/
http://anySiteHosting.com

By | 2011-06-20T08:05:33+00:00 June 20th, 2011|Computers, Documentation, Microsoft, VBA|0 Comments