How to fire an event after results from short cut key

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • CD Tom
    Contributor
    • Feb 2009
    • 495

    How to fire an event after results from short cut key

    I have a user that uses the ctrl F short cut, he places the cursor on a field then pressing the ctrl F and types in the information he is searching for. My question is after the information from the search is on the screen is there a way to fire off a event?
  • ADezii
    Recognized Expert Expert
    • Apr 2006
    • 8834

    #2
    I imagine that you would have to capture the CTL+F Key sequence, then replace the Standard Find Dialog with your own via a Custom Form. From this point, you would have much greater flexibility.

    Comment

    • CD Tom
      Contributor
      • Feb 2009
      • 495

      #3
      I'm not sure just how to capture the key sequence.

      Comment

      • ADezii
        Recognized Expert Expert
        • Apr 2006
        • 8834

        #4
        1. Set the Form's KeyPreview Property to Yes (Critical).
        2. Place the following Code in the KeyDown() Event of your Form.
        3. Now, when CTRL+F is pressed, the Standard Find Dialog will not appear, the code in the KeyDown() Event of the Form will be processed instead. This is where you will Open your Custom Find Form.
          Code:
          Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
            If KeyCode = vbKeyF And Shift = acCtrlMask Then
              'CTRL+F was pressed and captured, open Custom Find Form
            End If
          End Sub

        Comment

        Working...