i have a program that requires that the arrow keys be converted to act as tab keys moving back and forth between objects on my form.
here is some code that i picked up from msdn, but does not seem to work when moving outside of the frame with focus (moving from object to object within the fram works fine).
If Screen.ActiveControl.TabIndex = Count - 1 Then
NextTabIndex = 0
Else
NextTabIndex = Screen.ActiveControl.TabIndex + 1
End If
For i = 0 To Count - 1
If Me.Controls(i).TabIndex = NextTabIndex Then
Me.Controls(i).SetFocus
Exit For
End If
Next i
i have also attempted to use the sendkey function, but this for some reason has been causing the num lock key to turn off without reason (irregularly).
Call SendKeys("{TAB}") or Call SendKeys("+{TAB}")
if anyone knows of a good work around that will keep my num lock key from turning off or can provide code that will allow me to check at the end of my function if the numlock key is off and to turn it back on if it did accidentally get shut off the points will be awarded to you. thanks.
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Private Const VK_TAB = &H9
public sub command1_click
keybd_event VK_TAB, 0, 0, 0
end sub