Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2010-01-07
5
Medium Priority
?
1,763 Views
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
0
Comment
Question by:Ok123
  • 2
  • 2
5 Comments
 
LVL 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 600 total points
ID: 26201517
AutoKeys should work in 2007 also.
0
 

Author Comment

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

Assisted Solution

by:DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 600 total points
ID: 26202030
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,
AutoKeys.gif
0
 
LVL 85
ID: 26206069
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.
0
 

Author Closing Comment

by:Ok123
ID: 31674051
Many thanks
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

810 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