Change Background Color of buttons

  • Thread starter Thread starter Sean
  • Start date Start date
S

Sean

I want to change the background color of some control buttons. Is this
possible? Here is some code I've tried:

Private Sub Form_Open(Cancel As Integer)

'Define Variable names for Colors
Dim lngGray As Long, lngBlack As Long

'Define Colors
lngGray = RGB(225, 225, 225)
lngBlack = RGB(0, 0, 0)

Me![btnSaveBox].BorderColor = lngGray
Me![btnSaveBox].ForeColor = lngBlack
Me![btnSaveBox].BackColor = lngGray

End Sub
 
Thanks for your help Steve, I'll give that a try.

Ahhh,.... Of course not -- that would make sense!

Just when I start to think I've got this Access thing licked I get a nice
new surprise.


Steve Schapel said:
Sean,

Access does not have any native functionality to control the
background colour of command buttons. However, there is a sample of
how to do it at http://www.lebans.com/cmdbutton.htm

- Steve Schapel, Microsoft Access MVP


I want to change the background color of some control buttons. Is this
possible? Here is some code I've tried:

Private Sub Form_Open(Cancel As Integer)

'Define Variable names for Colors
Dim lngGray As Long, lngBlack As Long

'Define Colors
lngGray = RGB(225, 225, 225)
lngBlack = RGB(0, 0, 0)

Me![btnSaveBox].BorderColor = lngGray
Me![btnSaveBox].ForeColor = lngBlack
Me![btnSaveBox].BackColor = lngGray

End Sub
 
Back
Top