Turn off Help

N

NevilleT

I am creating an online help function for an application. I want to have a
user hit F1 and get a custom help screen with information stored in a table
relating to that form and field. My only problem is how do I programatically
turn off the normal Access help? I am just about there with displaying my
own help screen but the Access help keeps popping up.
 
N

NevilleT

Thanks for the feedback Alex. What I am building is a help system where
users can add their own comments and tips hence the approach of using a
table. My help screen has an edit option.
I have it all working but by using F1 to fire it up (I use Key Down to check
if F1 is pressed on any text or combo) I also fire up Access help on the
right of the screen. If I could either stop Access help opening, or have
code to close Access help, it would be perfect.
I am using Access 2003 on Windows 7.
 
S

Stuart McCall

NevilleT said:
Thanks for the feedback Alex. What I am building is a help system where
users can add their own comments and tips hence the approach of using a
table. My help screen has an edit option.
I have it all working but by using F1 to fire it up (I use Key Down to
check
if F1 is pressed on any text or combo) I also fire up Access help on the
right of the screen. If I could either stop Access help opening, or have
code to close Access help, it would be perfect.
I am using Access 2003 on Windows 7.

I think you need to destroy the F1 keypress in the keydown event:

If KeyCode = vbKeyF1 Then
KeyCode = 0
'show your help form
End If
 
N

NevilleT

Thanks Stuart. That did the trick. One thing I did find was that it had to
be in the KeyDown, and could not be in a sub the KeyDown calls even if it was
the first line of the sub. Strange. Still it works and allows me to do what
I want.

Once it is working I should make a copy of the function available to the
Access community. It is a quick way around creating and managing help files,
and allows users to put in their own comments.
 
S

Stuart McCall

NevilleT said:
Thanks Stuart. That did the trick. One thing I did find was that it had
to
be in the KeyDown, and could not be in a sub the KeyDown calls even if it
was
the first line of the sub. Strange. Still it works and allows me to do
what
I want.
<snip>

The reason it only works in the KeyDown event is that KeyCode is passed to
the event procedure by VBA *by reference*. This means that if you alter it
in the procedure, the code that called it (VBA) will receive the new value.
Setting it to zero effectively 'throws away' the keypress.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top