Hi!
I've found a few topics online with people having the same issue, but couldn't find a proper fix. I hope I'll get lucky here!
The issue is this one: within a UserForm, pressing the TAB key will sometimes, instead of moving the cursor to the next control, act as a "text-tab" within the control.
A few details:
- I have set my tab order up
- TabKeyBehavior is set to false
- Anomaly happens with comboboxes and textboxes alike
Here are some topics I found online with the same question:
http://vbcity.com/forums/t/160991.aspx
http://www.mrexcel.com/forum/excel-questions/44922-help-tabbing-within-userform.html
http://answers.microsoft.com/en-us/...g/df08da25-2db5-4cb9-a9e0-227edc16fb11?auth=1
A fix I tried (which I thought would work) is this code:
I've been informed that the issue still occurs. Perhaps replacing "SendKeys "{TAB}"" with something like "next control in TAB order . setfocus" will do the trick? Or perhaps the line "KeyCode = vbKeyTab" doesn't always fire when tab key is pressed?
Help and insights welcome![Smile :) :)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
Thanks !
I've found a few topics online with people having the same issue, but couldn't find a proper fix. I hope I'll get lucky here!
The issue is this one: within a UserForm, pressing the TAB key will sometimes, instead of moving the cursor to the next control, act as a "text-tab" within the control.
A few details:
- I have set my tab order up
- TabKeyBehavior is set to false
- Anomaly happens with comboboxes and textboxes alike
Here are some topics I found online with the same question:
http://vbcity.com/forums/t/160991.aspx
http://www.mrexcel.com/forum/excel-questions/44922-help-tabbing-within-userform.html
http://answers.microsoft.com/en-us/...g/df08da25-2db5-4cb9-a9e0-227edc16fb11?auth=1
A fix I tried (which I thought would work) is this code:
Code:
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
'If TAB KEY is fired Force the pcursor to jump to the next control
If KeyCode = vbKeyTab Then
SendKeys "{TAB}"
End If
End Sub
I've been informed that the issue still occurs. Perhaps replacing "SendKeys "{TAB}"" with something like "next control in TAB order . setfocus" will do the trick? Or perhaps the line "KeyCode = vbKeyTab" doesn't always fire when tab key is pressed?
Help and insights welcome
Thanks !