Highlight Dropdown Box On Click

  • Thread starter Thread starter Alan Z. Scharf
  • Start date Start date
A

Alan Z. Scharf

I would like to have text of dropdown box highlighted when user clicks
anywhere in dropdown box, so user doesn't have to highlight text before
typing over.

How can I do this?

Thanks.

Alan
 
Alan said:
I would like to have text of dropdown box highlighted when user clicks
anywhere in dropdown box, so user doesn't have to highlight text before
typing over.

How can I do this?


You can use the Enter event and
Me.cmbTst.SelStart = 0
Me.cmbTst.SelLength = Len(Me.cmbTst)

BUT, this is usually not a good idea. What if the user just
wants to insert a character or select a portion of the text
to nodify?
 
Marsh,

Thanks very much for your reply.

1. I had to modify it a bit since I have two columns as below.

Note: The only event I could get it to work in was OnMouseUp.

' Highlight control when clicked
Dim intLength As Integer

intLength = Len(Me.ActiveControl.Column(1))
Me.ActiveControl.SelStart = 0
Me.ActiveControl.SelLength = intLength


2. In regard to behavior preferences, user pattern here is to type in
first
few letters of last name to go to desired name. Highlighting current
content of dropdown on enter would allow user to just type first few
letters., instead of having to backspace or cursor to clear existing name
in
dropdown.

A dropdowon box highlights anyway when the little arrow is pressed.

Thanks very much.

Alan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Combo Box Mouseover selection 4
Help With MS Access 4
drop down box issues 1
COMBO BOX vs Uppercase 6
Combo Box Dropdown 4
re run query using new combo box selection 2
Combo box question 1
Excel Count If Formula Question 1

Back
Top