Full Version: Tab Down Next Record In Continuous Form
UtterAccess Forums > Microsoft® Access > Access Forms
Kamulegeya
Hello Friends.

I want to use either the arrow down key or enter key to navigate to the next record in access 2007.

Any clues?
Jeff B.
I believe these are both standard actions in Access. Are you saying that your continuous form does NOT perform this way?
cheekybuddha
Hi,

First, set your form's Key Preview to 'Yes' (it's listed with the form's events in the properties dialog)

Then put the following code in your form's KeyDown event:
CODE
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)

  Dim strCtl As String
  
  strCtl = Screen.ActiveControl.Name
  Select Case KeyCode
  Case vbKeyReturn, vbKeyDown
    KeyCode = 0
    With Me.Recordset
      If Not .EOF Then .MoveNext
    End With
    Me(strCtl).SetFocus
  Case vbKeyUp
    KeyCode = 0
    With Me.Recordset
      If Not .BOF Then .MovePrevious
    End With
    Me(strCtl).SetFocus
  Case Else
  End Select
  
End Sub


hth,

d
Kamulegeya
cheekybuddha 's solutions works!

uarulez2.gif


Ronald
RAZMaddaz
Ronald, et. al.

Here are a bunch of other Key commands:

Access Key Commands

RAZMaddaz
cheekybuddha
Glad it worked, Ronald!

Good luck with your project thumbup.gif

d
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.