Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2004
    Posts
    130

    Unanswered: Assessing if User ends field with up/down key

    Numeric input field in table. User enters (say) 123.45 then the down arrow key. I would like to go to the next record in the table rather than across to the next field. Can't seem to figure out how. Ditto on up arrow key. Can anyone help?
    thank you,
    Winston

  2. #2
    Join Date
    Apr 2004
    Location
    outside the rim
    Posts
    1,011
    Code:
    Private Sub Text1_KeyUp(KeyCode As Integer, Shift As Integer)
    
        On Error Resume Next
        If KeyCode = 40 Then
            DoCmd.GoToRecord , , acNext
            If Err Then
                DoCmd.GoToRecord , , acNewRec
                Err.Clear
            End If
        End If
    End Sub
    have fun

  3. #3
    Join Date
    Apr 2004
    Location
    outside the rim
    Posts
    1,011
    oh yeah, for the others:

    Key Code Arrow Key
    37 -------- Left
    38 -------- Up
    39 -------- Right
    40 -------- Down

    You'll be most efficient with a "Select Case" on the KeyCode and move the record in the correct direction.

    Have Fun!
    tc

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •