Defining and using vbKeyF1

  • Thread starter Thread starter PaulB
  • Start date Start date
P

PaulB

In one of my applications, I created some forms which act as a
help-function.
What I want to acchieve is that when a user presses F1, this help form
is opened. I succeeded in this using VbKeyF1 in the code.
But: at the same time, the 'normal' Access help window is opened,
which I do not want at that moment. How can I prevent that the Access
help window is opened upon pressing F1?
Of course, I can say that the users should use e.g. the F2 key to open
the help screen. But F1 is more logical for a help function.
Thanks in advance for the suggestions.

Paul
 
There are two things that you require, a Macro
entitled "AutoKeys" and a function inside a module that
controls what is run.

Create a Module (AutokeysFunctions) and create a function
(LauchHelp) inside the function.
Create your VB Code to open the required objects (you may
want to condition this code!!).
Compile, save and close the module.
Create an Autokeys Macro, display the "Macro Name" column
for the Macro, type in "{F1}.
In the Action column, select RunCode, you will now notice
at the bottom of the Macro a box appears
entitled "Function Name", click in this box then use the
Build Button that appears to select the Function you have
just created.

Remember to alter the Function LauchHelp whenever you want
to build in more Help File control.

HTH



Tony C.
 
Tony C said:
There are two things that you require, a Macro
entitled "AutoKeys" and a function inside a module that
controls what is run.

Create a Module (AutokeysFunctions) and create a function
(LauchHelp) inside the function.
Create your VB Code to open the required objects (you may
want to condition this code!!).
Compile, save and close the module.
Create an Autokeys Macro, display the "Macro Name" column
for the Macro, type in "{F1}.
In the Action column, select RunCode, you will now notice
at the bottom of the Macro a box appears
entitled "Function Name", click in this box then use the
Build Button that appears to select the Function you have
just created.

Remember to alter the Function LauchHelp whenever you want
to build in more Help File control.

HTH



Tony C.

Tony,
Thank you for this answer. I tried it and it works!

Paul
 
Back
Top