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
LVL 5
rberkeConsultantAsked:
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)

mx
0
GRayLCommented:
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
0
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)
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

GRayLCommented:
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.
0

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:
GrayL.  

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

Thanks.

Bob
0
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
That is some serious 'bustedness' !!
0
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.  
0
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 ....

mx
0
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).

Bob

0
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
10-4
0
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.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.