Select value in combo box

atisz

Registered User.
Local time
Today, 14:42
Joined
Apr 5, 2005
Messages
96
Hi,


I'm trying to integrate a solution for easy selection of a value from combo box, based on the key the user press on the keyboard. So, the focus is on the combo box, the user have to select from this a value wich starts with "h" for example, and to avoid scrolling trough all the values from the combo box, he simply push key "h" on keyboard to jump to the first value starting with this letter.
This should make simplyer entering data on forms, without the necessity of using mouse.
Any idea how can be done?
 
Hi Atisz
If you have a combo box already loaded on your form, then it should be working like this automatically?
 
Hi Atisz
If you have a combo box already loaded on your form, then it should be working like this automatically?


It would be nice! But it's not working like this automatically! Not with ms access 2000. This is the reason why I ask for help.
 
Liddlem is correct. It should work like that in Access 2000. Can you post a copy of your DB so we can see what is really happening
 
Yes, both the two replies are correct. By default access 2000 will automatically bring it the first value as per the typed value.
 
Atisz,

I wonder why this is not happening for you...?? But anyway, the workaround, just to give a temporary solution here, would be this...
Code:
Private Sub ComboBoxName_KeyPress

  if keyascii = [color=red]Put an ASCII decimal here to represent a "show list" key on the keypad[/color] then
    me.ComboBoxName.rowsource = 
      "SELECT table.field
        FROM table
          WHERE [field] LIKE Forms!CurrentForm!ComboBoxName & '*'"
            me.ComboBoxName.dropdown
  end if

End Sub
** You would just have to assign a key of choice to use as a "query" key, which is what you would press to get a filtered list based off of the first one, or two, or whatever number of characters have been typed.

Example - Type "My" into the combo box, press the query key, and get a filtered list of values shown that start with the two characters "My".
 
My mistake

Hello everyone,


Thanks guys for your replays, the mistake was all mine. I'm working on several projects and I just mixed them. It wasn't a simple combo box, it was one wich included an ID and a Product name field. This was the reason why the combo box wasn't working as it should.

Thanks again, and sorry for the confusion what I have made.
Attila.
 

Users who are viewing this thread

Back
Top Bottom