473,320 Members | 1,950 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Conditional formatting of combo box (highlighting colour)

Hi,

I changed text color of my combo box on my form but when i click on the combo box, the first highlighted option is almost unreadable (black background and orange text (!?!)).
Is there a way with conditional formatting to change text color and background when i hover mouse over it?

Thanks
Feb 8 '16 #1
7 1744
Seth Schrock
2,965 Expert 2GB
You would need to do this using the On Got Focus and On Lost Focus events. There are On Mouse Move and On Mouse Down (when you click) events that you can use as well, but I think that what you want would best be placed in the focus events. Just change the properties that you want in code for each event and it should work great.
Feb 8 '16 #2
ok.

forecolour of all text in combo is blue.

in code (event - on got focus) i changed forecolour to white (hex number) and on lost focus back to blue.
And for the result, when i click on combo box, all text turns to white, not only text on which mouse is hovered.


for the record, i'm new in ms access and still learning, so forgive for my mistakes
Feb 9 '16 #3
Seth Schrock
2,965 Expert 2GB
I missed that detail of what you were wanting. I have a general idea of how I would try to do it, but it isn't something that I know for sure how to do it. The Mouse Move event has two parameter called X and Y which give the coordinates of the mouse. You would need to find out which record the mouse is over based on those coordinates and then set the conditional formatting to change the colors for the ID of the record that you are hovering over.

I'm sorry I can't be more of a help to you. Please post back if you do find the solution. I would be very interested in knowing how to do this.
Feb 9 '16 #4
Uh, that's far more complicated than I thought..
So I'm basically forced to use only black/gray text colour in entire form, because in dropdown menu highlighted text becomes almost unreadable and orange.. That's great..

Thanks for the effort and help. If i find the solution, I will post here.
Feb 10 '16 #5
jforbes
1,107 Expert 1GB
You can use other colors. I would only change the background color and only to a relatively light color. I do this all the time and it works great. It's when changing the foreground color away from Black things tend to get un-readable.
Feb 10 '16 #6
zmbd
5,501 Expert Mod 4TB
which version of office/access are you using?
Feb 10 '16 #7
I think I will just change label's forecolor and leave text boxes and combos default black. It looks acceptable.
I am using 2010 version.
Feb 11 '16 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Terry | last post by:
I have a form which displays data from both the Student Details table and the Exam Details table. The Name (Text Box) control is from the Student Details table and the Withdrawn (Check Box)...
2
by: jeffgeorge | last post by:
Trying to add 3 colors to 6 combinations of text possibilities. If this makes sense, the possibilities are: A D (one color for the combo beginning with A) A E B D (One color for the combo...
4
by: Bradley | last post by:
I have an A2000 database in which I have a continuous form with a tick box. There is also a text box with a conditional format that is based on the expression , if it's true then change the...
2
by: Megan | last post by:
Can you write conditional VBA code that affects only one or two records on a continuous subform? I have a form with a subform on it. The parent/ child field that links the forms is CaseID. The...
5
by: Andrew Chanter | last post by:
Does anyone know a way you can use conditional formatting to create a banded style view as is commonly seen on the internet. (In othe words the first record appears on a gray background, the 2nd...
4
by: midlothian | last post by:
Hello, I have conditional formatting set up on a subform based on a calculated value in the underlying query. For instance, if Sales are >$1000, the query displays "Yes," otherwise it displays...
1
by: aman909 | last post by:
Hello, Im trying to use conditional formatting in a text box on a form. What im trying to do is that conditional formatting changes the colour of the text in the text box. I need the...
3
by: aeon | last post by:
Working in Access 2007 on XP I have a combo box that I'm using in a form to select the WorkCategory assigned to a particular person in my database. WorkCategory is a lookup field in a table...
3
by: MarcinM | last post by:
Hello, I would like to highlight the active cell in a subform (datasheet). It is possible to use conditional formatting to achieve that, but I would like to use a different colour than the ones...
4
mjoachim
by: mjoachim | last post by:
Hello Everyone! I have a continuous form that is used to enter time data. I have a couple fields, such as employee number, that are Combo Boxes. The user is able to enter an employee number that...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.