Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo Box Properties: Locked but not really... 1

Status
Not open for further replies.

sagamw

Technical User
Nov 11, 2009
104
GR
[access 2007]
Is there a way to prevent the user from putting the cursor inside the text part of a combo box?

I tried some properties (locked, enabled) combinations but It didn't work as expected. If you have the enable=no then you can't click the box's arrow. If it is locked you can't select a value.

I just need the combobox's arrow and the list to be functional but I don't want the user to click in the text part of the combo and try to write values in it.
 
Thanks pwise but it was yes already. You can still write text in the box. (you just get the not in the list message, that you can intercept with not in the list event etc.)

I'm looking for a way for the text part of the combo to behave as Locked, but the arrow part and the selection to remain functional.
 
Thanks pwise.
It's not 100% (I can still click and put the cursor inside the text part of the combo) but it's good enough, so I give you a star for that.

 
Add to the GotFocus event
Code:
Me.ComboBoxName.Dropdown
 
also add this to the on change event

for pasteing<CTRl-V>

Code:
Me.CmbProviderid.Undo
Me.CmbProviderid.SelStart = 0
 
sorry SB

Me.ComboBoxName.Undo
Me.ComboBoxName.SelStart = 0
 
Thanks again.
Nice set of commands and ideas.
Although I found that in some cases the .Dropdown forces the combolist to open twice. (You make the selection and the list pop ups again)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top