Stay in Combobox when reaching end

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

When I tab into my Combobox and with <keydown> scrolls down through the
values in it I have this problem:
When I reach the last value and once more press the <Keydown> the cursor
jumps out of the Combobox and to the next Tabstop.

I have the same problem with my Listboxes
 
I have just tried it on a userform and it stays in the listbox for me.

Do you have any control code for these boxes?
 
The only code besides the properties for the Combobox is this:

Private Sub ComboBox8_1_DropButtonClick()
Me.Controls("ComboBox8_1").RowSource =
Range("ANLGSSAML").Offset(1).Range("A1:A" & Tael16).Address
End Sub

Private Sub ComboBox8_1_Enter()
Me.Controls("ComboBox8_1").RowSource =
Range("ANLGSSAML").Offset(1).Range("A1:A" & Tael16).Address
End Sub


"Bob Phillips" skrev:
 
You will have to have a TextBox on the same form (with Tabstop enabled) so
that when you reach the end of the ComboBox your curser has somewhere to go

"Bob Phillips" skrev:
 
Hi Akyhne,
When I tab into my Combobox and with <keydown> scrolls down through the
values in it I have this problem:
When I reach the last value and once more press the <Keydown> the cursor
jumps out of the Combobox and to the next Tabstop.

Use the KeyDown event to check if the down key is being pressed when the
listindex = listcount-1 and set the key to 0 if so. (You can also check if
the Up key is being pressed with a listindex = 0).

Regards

Stephen Bullen
Microsoft MVP - Excel
www.oaltd.co.uk
 

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

Back
Top