Results 1 to 5 of 5
  1. #1
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    1,919

    Key Down event not firing

    Can't figure out why Key Down event doesn't fire when I press the Esc key. (On Key Press doesn't fire either when Esc key pressed.)

    Click image for larger version. 

Name:	000.jpg 
Views:	12 
Size:	36.1 KB 
ID:	26473

  2. #2
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    1,919
    I found this, but none of my command buttons have their Cancel property set to yes.

    The KeyDown event does not occur when you press:


    • The ENTER key if the form has a command button for which the Default property is set to Yes.

    • The ESC key if the form has a command button for which the Cancel property is set to Yes.







  3. #3
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    1,919
    Still not sure why the event doesn't fire with the form's key down event, but I moved the event to the combo box where it probably should have been from the start. The event moves the focus off the combo box and then renders it invisible when the Esc button is pressed.

  4. #4
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Is the KeyPreview Property set to Yes; It has to be for KeyDown event to fire.

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  5. #5
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    1,919
    I did not know that. The form's KeyPreview property remained at its default value of "No". I'll leave the solution as is, in that it's more appropriate to the app. I will test the KeyPreview setting just for my own education.
    Thanks,
    Bill

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

Similar Threads

  1. Replies: 2
    Last Post: 03-26-2014, 07:30 AM
  2. Replies: 14
    Last Post: 03-19-2013, 12:16 AM
  3. tab control - firing a page on-click event
    By Chuck55 in forum Programming
    Replies: 7
    Last Post: 05-01-2012, 09:57 AM
  4. Replies: 5
    Last Post: 03-02-2012, 04:43 PM
  5. Form level mouseup event not firing
    By Philhoop in forum Forms
    Replies: 3
    Last Post: 07-22-2010, 09:41 AM

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