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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

don't edit text in combobox 1

Status
Not open for further replies.

NewTexican

Technical User
Dec 10, 2004
95
US
Would someone please point me to the code that would allow one to select an entry in a combobox but would not allow one to edit the actual text? The combobox is filled with a query. I have limit to list set to yes.
 
You may play with the AutoExpand property and the Dropdown method of the Combobox object.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Change the combo's "Locked" property to "Yes"

VBSlammer
redinvader3walking.gif

[sleeping]Unemployed in Houston, Texas
 
if you do that then you can't select a different row from the box.
 
My bad...you can trap the user's keystrokes and nullify them (allow the tab key):
Code:
Private Sub cboFixed_KeyPress(KeyAscii As Integer)
  If KeyAscii <> 9 Then
    KeyAscii = 0
  End If
End Sub

VBSlammer
redinvader3walking.gif

[sleeping]Unemployed in Houston, Texas
 
Thanks houstonian. I didn't get a chance to try this. This is an unfamiliar concept to me. I went ahead and changed the whole thing I was trying to do around, it was getting way to complicated, but I'll keep this suggestion on the backburner and play with it when I get the chance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top