Using F1 to call custom help

N

Nandini

I need to create a macro called AutoKeys for this. Inside this macro, would
have 1 line with {F1} as the macro name and then RunCode as the action. I
would like to create Open_Help()function in a module to open up my own help
file. I want to know the exact code. Kindly help me.
Best regards,
 
D

Dale Fye

Nandini,

I've never used a .chm help file (guess I should figure that out). I
generally include a table (tbl_Help) in my applications which contains fields
(FormName, CtrlName, HelpText). I record the form and control name of the
controls on my forms (I have some code that loops through the forms and
controls to do this), and then add the help text for the various controls.

I then set the KeyPreview property to Yes on my forms, and in the KeyDown
event, check to see whether the keycode is the F1 key.
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)

If KeyCode = vbKeyF1 Then
CommandBars("myHelpMenu").ShowPopup
KeyCode = 0
End If

End Sub

If it is, it pops up a shortcut menu that allows them to select whether they
want help on the page (if it is a tab control) or the control with the focus.
This then calls a function that opens my Help form to the appropriate record
by using the Where parameter of the OpenForm method.

--
HTH
Dale

email address is invalid
Please reply to newsgroup only.
 
N

Nandini

Thanks for your kind help. I should try and later I will contact.
Best regards,
 

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