Prevent users typing in text in a combo box, Access 97

eyewonder

New member
Local time
Today, 16:43
Joined
Dec 15, 2011
Messages
9
While designing a form & putting various controls on it, and switching to 'code view', the top of the window has 2 combo boxes - left one for the labels, command buttons, etc that I have placed on the form. The right combo box allows me to look at the properties of the selected object. While designing my form and wanting to deal with one of the objects, I can type a single letter in the left combo box (such as c) and the 1st 'c' object, likely a command button, is hi-lited. I can not type any more letters in the combo box to select a different object. Thus I am prevented from having anything in the text box that is not already loaded into it.

On my form I have combo box with a row source of 'qry_employees'. I would like to have my combo box exhibit the same behavior as the combo box in the code view window. At the moment, I can type the first letter of the employee's name, & it pops up, as desired, but I can continue entering text in the combo box, which causes other problems

Is there a way to prevent users from typing anything into the combo box, forcing them to scroll & click the selected name? I have played with all the properties for the combo box, but no luck.

Cheers
Steve
 
Hi. Not sure you can do that with just a Combobox. You might be able to simulate it with a Textbox and a Combobox together.
 
Set the AutoExpand property to No.

Cheers,
Vlad
 
it's a good feature though. I wouldn't prevent it. Train the users, and make sure the cboBox is set to "limit to list"
 
See if this fake gives the desired results. Kind of what @theDBguy suggested.
Code:
Private Sub Form_Load()
  HideList
End Sub

Private Sub lstProduct_AfterUpdate()
  Me.txtProduct = Me.lstProduct
  HideList
End Sub

Private Sub lstProduct_Exit(Cancel As Integer)
  HideList
End Sub
Public Sub HideList()
  Me.lstProduct.Height = 0
End Sub

Public Sub ShowList()
  Const theInches = 3
  Me.lstProduct.Height = 1440 * theInches
End Sub

Private Sub txtProduct_KeyDown(KeyCode As Integer, Shift As Integer)
  ShowList
End Sub

Private Sub txtProduct_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  ShowList
End Sub
 

Attachments

I will try some of the suggestions, but I'm expecting to get hit with rolling blackouts shortly (SE Kansas, USA - burrr -4 F
 

Users who are viewing this thread

Back
Top Bottom