Results 1 to 3 of 3

Thread: Convert RETURN to TAB

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2000
    Location
    UK
    Posts
    24
    I have the following bits of code on my form

    Private Sub l_surname_KeyPress(KeyAscii As Integer)

    KeyAscii = UCaseKeyPress(KeyAscii)

    End Sub



    Private Sub l_surname_LostFocus()
    '
    If Not g_exit_pressed Then
    checkTextBox l_surname
    End If
    '
    End Sub



    Private Sub Form_KeyPress(KeyAscii As Integer)
    If KeyAscii = vbKeyReturn Then
    SendKeys "{tab}"
    End If
    End Sub


    The code works fine, and the return key send a tab. BUT, when leaving the l_surname field with the return key I het a 'Ping' sound from windows.

    Any Ideas Folks?

    Cheers

    Neil


  2. #2
    Addicted Member
    Join Date
    Apr 1999
    Location
    Ruinen, Drente, Netherlands
    Posts
    192
    make:
    If KeyAscii = vbKeyReturn Then


    as:
    If KeyAscii = vbKeyReturn Then
    KeyAscii = 0

    and I think it will work without "Ping"

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jan 2000
    Location
    UK
    Posts
    24

    Cool

    Kars

    Many Thanks for your help.

    That worked a treat.

    Cheers

    Neil

Posting Permissions

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



Click Here to Expand Forum to Full Width