How to assign form backcolor at form open?

So why doesn't this work.  It displays the form background as grey.

Even when I manually change the backcolor using the gui, the form still opens as grey.

Private Sub Form_Open(Cancel As Integer)
Me.Detail.BackColor = RGB(0, 255, 0)
End Sub
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:

me.Section(acdetail).BackColor =RGB(0, 255, 0)

Are you calling the color change from the same form?  If not, try:

forms!form1.Detail.Backcolor = RGB(0,255,0)

form1 is the name of the form in which you are changing the backcolor
Jeffrey CoachmanMIS LiasonCommented:
This only happens with: 0,255,0?

What about: 255,0,0
...or: 0,0,255

or even: RGB(247,102,153)
10 Tips to Protect Your Business from Ransomware

Did you know that ransomware is the most widespread, destructive malware in the world today? It accounts for 39% of all security breaches, with ransomware gangsters projected to make $11.5B in profits from online extortion by 2019.

I've just tested the code in your question on my test form and it works.  I suspect your form is 'busted'.  Try creating a new form with no controls and insert that same code in the On Open event - my money says it should work - or the mdb is defective in which case open a new mdb and import all the objects form the old form into the new.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rberkeConsultantAuthor Commented:

Yep, it was "Busted".  I rebuilt it and all is well.


DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
That is some serious 'bustedness' !!
rberkeConsultantAuthor Commented:
Well, to be honest, in rebuilding it I fixed some other code.  Another event was calling a subroutine the also changed background color.  So, this Bust, was my fault, not MS Access.  
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
You should really probably give all the points to gRay ... cuz your original code was fine, and he suggested the real fix .... just saying ....

rberkeConsultantAuthor Commented:
It was originally 250 points.  When I realized it was my own dumb fault, I raised it to 500 so that he could get the original 250 plus points to others for trying to help the helpless (me).


DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.