Results 1 to 6 of 6
  1. #1
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Looking fro On Key Down (Ctrl

    I have datasheet form entering data.

    When I

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Looking fro On Key Down (Ctrl

    Create a new macro.
    In Design view select View / Macro Names.
    In the macro name column enter : {F6}
    In the action column enter : SendKeys
    In the keystroke textbox enter : ^"
    Save the macro and name it AutoKeys.
    If you want to test it immediately, run the macro.
    The AutoKeys macro will be run automatically every time you start the db.
    Francois

  3. #3
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Looking fro On Key Down (Ctrl

    Hi Francois

    I couldn

  4. #4
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Looking fro On Key Down (Ctrl

    John,

    You'll have to use F5 instead of F7 as F7 is launching the spell checker
    Francois

  5. #5
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Looking fro On Key Down (Ctrl

    John,

    In the form module create a sub :

    Sub CopyRecord()
    Dim cnt As Control
    For Each cnt In Me
    If cnt.ControlType = acTextBox Then <font color=red><----Here you can add other control types if you want.</font color=red>
    cnt.SetFocus
    SendKeys "^"""
    DoEvents
    End If
    Next cnt
    End Sub

    In the On KeyDown of each textbox, add the following lines :

    Private Sub TextboxName_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = vbKeyF5 Then
    Call CopyRecord
    End If
    KeyCode = 0
    End Sub

    HTH
    Francois

  6. #6
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Looking fro On Key Down (Ctrl

    Francois

    I saw that, it's working, thanks for you help.

    John

Posting Permissions

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