what is the backcolor value of a disabled textbox

hey guys,

when i set a textbox to enabled = false, the onclick event doesn't work anymore. the work around is that instead of setting it to false, i will keep it enabled but locked and change the backcolor to the same grey that a disabled textbox has as well.

but i can't seem to find the backcolor of that anywhere!!! help!!

can someone give me the value of the disabled textbox backcolor?

tried Debug.Print Me.txtUploadDate.BackColor when it's disabled but that doesn't return the correct result - 16777215 is incorrect
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.

I believe this varies between different versions of Access (and possibly other factors).

I'd suggest placing two textboxes side by side -- one disabled, the other not, and in design view use the popup pallette to match the color as closely as possible, and set the back color of the enabled textbox to an acceptable match.  Once you do that, you can read the the matching back color setting of the enabled textbox.

For example, in Access 2010  #ECECEC seems very close to me.
This looks like a resource -- a color chart.  The last column applies to Access VBA:
developingprogrammerAuthor Commented:
ouch! no exact way of doing it!! = ((

haha but no problem i'll do just that - thanks mbizup!! = ))

hrmm mbizup sorry one silly question - how do i make a constant that i can set to backcolor using #ECECEC?

right now my code is this

Const cintGREYDISABLED      As Long = 13882323
Me.txtTransactionDate.BackColor = cintGREYDISABLED

how do i do the same with #ECECEC? thanks!! = ))
Newly released Acronis True Image 2019

In announcing the release of the 15th Anniversary Edition of Acronis True Image 2019, the company revealed that its artificial intelligence-based anti-ransomware technology – stopped more than 200,000 ransomware attacks on 150,000 customers last year.

käµfm³d 👽Commented:
You could use a color picker tool to get the color of one of the pixels within the disabled box. Most tools such as these will provide you with a hex representation of the color value. To convert to the Long that your code needs, just open up the Windows calculator, enable Programmer mode, select the "hex" radio button, paste the hex value, and then click the "dec" radio button.


Prefix it with &H to define it as Hexadecimal  :-)

Me.txtMyTextBox.BackColor = &HECECEC
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
An indispensible free tool that I use often is ColorPix - quick and simple, shows any color anywhere in 4 different formats.

Go here

then select ColorPix.
Nothing to install - just run the EXE .


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
developingprogrammerAuthor Commented:
whao guys!! fantastic stuff!! thanks so much for it!! = ))

mbizup thanks for the &H tip! now i know how to convert hex to longs!! but where can i find this &H in the help file? i just want to know how to find the answers so i can be independent and do my due diligence before asking = )

thanks kaufmed! i didn't know calculator has a programmer mode!! haha now i know!! = ))

O M G   kaufmed!!!! i didn't know calculator has SOOOOO many functions!!!! i'm totally blown away now man!!!!! i just went through ALL the views calculator has an   O M G . hahaha that is just unbelievably cool!!!! = )) thanks for opening this door up!!!! = ))


databasemx!! i really like the tool you recommended me the most and i used it to get the colour of the Access 2007 disabled textbox - for anyone who wants to know, it's D3D3D3! = ))

thanks EVERYONE!! = ))
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
Well ... as mbizup noted ... the color is going to very in Access versions as well as on different monitors ...

But yes ... CP is pretty darn cool.

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.