Results 1 to 2 of 2
  1. #1
    MartinLutfer is offline Novice
    Windows XP Access 2003
    Join Date
    May 2011
    Posts
    2

    How to create Hotkey to open Query

    Hi everyone
    I am create a database in Access and I want to create Hotkey{F3} to open one of my Querries. I use this code:
    Code:
    Private Sub SomeControl_KeyPress(KeyAscii As Integer)
      If KeyAscii = 114 Then
        DoCmd.OpenQuery "My Querry"
        KeyAscii = 0 
      End If
    End Sub
    but it doesn't work :S
    Could anyone help me, please

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    you can find the number for the key you want with this code:

    Code:
    asc(chr(KeyAscii))
    press the key, use that code to get the ASC number and then put that number in your conditional and perform the check using the ASC() function instead.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. How Can I Create This Query
    By djclntn in forum Queries
    Replies: 3
    Last Post: 02-26-2011, 12:02 PM
  2. how create this query???
    By daniel.preda in forum Queries
    Replies: 7
    Last Post: 12-28-2010, 03:27 PM
  3. How do i create a new field in a query
    By jayjayuk in forum Access
    Replies: 3
    Last Post: 10-12-2010, 09:06 AM
  4. Accessing a Tab with a HotKey
    By SCFM in forum Programming
    Replies: 2
    Last Post: 03-13-2010, 07:28 AM
  5. Using a query to create
    By DamnYankees in forum Queries
    Replies: 2
    Last Post: 10-08-2009, 07:38 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums