How to highlights the current record on listbox (1 Viewer)

Falcon88

Registered User.
Local time
Today, 09:35
Joined
Nov 4, 2014
Messages
299
Hii all dears

I have a form that displays single records of a data.
On that form there a list box to show the dates of current patient visits .
My question: how to highlight the date (on the listbox) of the current visit of that patient ?
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 23:35
Joined
Oct 29, 2018
Messages
21,473
Do you mean like "select" that item on the ListBox?
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 01:35
Joined
Feb 28, 2001
Messages
27,186
Look through this post.


Not sure if this will do what you want, but the discussion in the linked thread sounds about right.
 

Falcon88

Registered User.
Local time
Today, 09:35
Joined
Nov 4, 2014
Messages
299
I meant:
How do I make the current record on the listbox highlighted in a different color than the rest of the displayed items?
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 02:35
Joined
May 21, 2018
Messages
8,529
A standard Access listbox cannot do color formatting. You can use a listview, but these are hard to work with ActiveX controls. The easier is to fake a listbox with a subform.
 

isladogs

MVP / VIP
Local time
Today, 07:35
Joined
Jan 14, 2017
Messages
18,221
Sorry. I've only just seen this thread
The selected item in a listbox is automatically highlighted. No code or action needed! For examnple

1699782793724.png


However it higlights all field in that listbox record
Am I missing something in the question asked?
 

isladogs

MVP / VIP
Local time
Today, 07:35
Joined
Jan 14, 2017
Messages
18,221
What does it look like when the focus is on another control?
Providing the listbox row is clicked, it looks exactly the same. The record is still selected.

This particular listbox also works for a mouse move.
Of course, using a mouseover event is transitory. The 'selection' is lost when the mouse is moved away
 
Last edited:

Users who are viewing this thread

Top Bottom