Hum, I assume when you say "tab", you are talking about a tab control?
I would not take away the left/right arrow keys...as then how can a user
edit data in a field? They need the arrow keys to move within that field. If
the whole field is highlighted when the cursor enters..then you can normally
use the left/right arrows to move to the next/previously control (is this
what you are asking for now???). However, if a users is actually
typing/editing data in a control..then they need the left right arrow keys
for editing.
I don't think it is a very good idea to steal those keys, as then how can a
user edit text in a field?
You can usually hit ctrl-TAB to jump to the next tab. Also, perhaps
ctrl-right arrow, and ctrl-left arrow might be a possible keys to use..but I
can't see stealing the left/right arrow keys.
To steal the ctrl-right/ and left key, you can add the following code to
your keydown handler:
Dim intTabCount As Integer
Const TabMax As Integer = 1 ' max number of tabs
(less 1, since this is zero based)
If (Shift And acCtrlMask) > 0 Then
Select Case KeyCode
Case vbKeyRight
KeyCode = 0
intTabCount = Me.TabCtl18 + 1
If intTabCount > TabMax Then
intTabCount = 0
End If
Me.TabCtl18 = intTabCount
Case vbKeyLeft
KeyCode = 0
intTabCount = Me.TabCtl18 - 1
If intTabCount < 0 Then
intTabCount = TabMax
End If
Me.TabCtl18 = intTabCount
End Select
End If
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl************* ****@msn.com http://www.attcanada.net/~kallal.msn