A
andy
I have a page with many objects (textboxes, Option
buttons, comboboxes). There are more objects than can fit
on the display screen. I have used the code below to tab,
shift/tab back and forth between objects on the page
Does anyone know how to code to accomplish the following:
When a field which I have progressivly tabbed into, is
beyond the display screens view (below), I would like the
screen to shift down the page so that the object which I
have tabbed into, which has the focus (e.g.
textbox1.activate) is in my view without me having to
scroll down, or do any extra keystrokes.
Private Sub cboEnergyType_KeyDown(ByVal KeyCode As
MSForms.ReturnInteger, ByVal Shift As Integer)
Select Case KeyCode
Case vbKeyTab, vbKeyReturn, vbKeyDown, vbKeyUp
Application.ScreenUpdating = False
bBackwards = CBool(Shift And 1) Or (KeyCode =
vbKeyUp)
If Application.Version < 9 Then Sheet1.Range
("A1").Select
If bBackwards Then
With Me.txtStopPayComments
.Activate
.SelStart = 0
.SelLength = Len(.Text)
End With
Else
With Me.txtAcctNo
.Activate
.SelStart = 0
.SelLength = Len(.Text)
End With
End If
Application.ScreenUpdating = True
End Select
End Sub
Thank you in advance
God bless you
buttons, comboboxes). There are more objects than can fit
on the display screen. I have used the code below to tab,
shift/tab back and forth between objects on the page
Does anyone know how to code to accomplish the following:
When a field which I have progressivly tabbed into, is
beyond the display screens view (below), I would like the
screen to shift down the page so that the object which I
have tabbed into, which has the focus (e.g.
textbox1.activate) is in my view without me having to
scroll down, or do any extra keystrokes.
Private Sub cboEnergyType_KeyDown(ByVal KeyCode As
MSForms.ReturnInteger, ByVal Shift As Integer)
Select Case KeyCode
Case vbKeyTab, vbKeyReturn, vbKeyDown, vbKeyUp
Application.ScreenUpdating = False
bBackwards = CBool(Shift And 1) Or (KeyCode =
vbKeyUp)
If Application.Version < 9 Then Sheet1.Range
("A1").Select
If bBackwards Then
With Me.txtStopPayComments
.Activate
.SelStart = 0
.SelLength = Len(.Text)
End With
Else
With Me.txtAcctNo
.Activate
.SelStart = 0
.SelLength = Len(.Text)
End With
End If
Application.ScreenUpdating = True
End Select
End Sub
Thank you in advance
God bless you