How to disable Function keys(f1 to F12) in access2007

Posted on 2010-01-07
Last Modified: 2012-05-08
I have a access2000 application and i must upgrade to 2007. In some forms function keys like f5 or f6 are used to open other forms or doing some tasks so i must disable the original function of each keys. I did a macro to fix the problem : ex: {f1} with action : stop the macro and the name of the macro is Autokeys. It works good however  i would know if it is possible to  code in vba the same thing. On EE i found some code but it's not working (db.Properties("AllowSpecialKeys") = False) . Thanks
Question by:Ok123
    LVL 84

    Accepted Solution

    AutoKeys should work in 2007 also.

    Author Comment

    Ty for your reply but, i have a startfunction after my autoexec macro, is it not better to insert some code in this area ?
    LVL 75

    Assisted Solution

    by:DatabaseMX (Joe Anderson - Access MVP)
    The easiest way to disable any key, F1 or other is in the AutoKeys macro as follow:

    Macro Name = the Key you want to trap.
    Action = Beep

    In the same manner, you can trap the Shift, Control and Shift/Control versions also ...
    +KeyName    SHIFT + Key
    ^KeyName    CONTROL+Key
    +^KeyName  SHIFT+CONTROL+Key

    See attached image,
    LVL 84
    You can use VBA, but you have to trap all keystrokes at the form level, and you cannot trap keystrokes on Tables or Queries using VBA. In short, the AutoKeys is the best method to use.

    Author Closing Comment

    Many thanks

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Suggested Solutions

    Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
    Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now