Calling Access Help or Custom Help

N

Norbert Meiss

I have a custom help file associated with the forms in my Access 2003 project
and use the AutoKeys macro to redirect F1 to run a funtion which calls the
custom help file. This is fine for the end user in the ade (compiled
version). However the developer wants to get access to the context sensitive
help for Access itselt.
So I enhanced the Autokeys macro with a condition which checks the last
digit of CurrentProject.Name. If this is = 'E' I call the custom function,
but what do I enter as action to call the Access context help?
Or is there a complete other approach?
TIA, Norbert
 
A

Allen Browne

The function below will help you determine whether the file is an MDE rather
than relying on the file name to be correct. You could use the KeyDown event
of the form to determines if it is F1 in an MDE: if so destroy the keystroke
and call your routine, and if not let Access process the keystroke normally.

But the ususal way to handle is to set the HelpFile property of the form,
and use the HelpContextID of the form or control to give the desired
context-sensitive help. The normal help is then available in design view,
and in the code window.

Public Function IsMDE(strDB As String) As Boolean
On Error GoTo Err_Handler
'Purpose: Retutn True if this is an MDE.
Dim db As DAO.Database

Set db = DBEngine.OpenDatabase(strDB)
If db.Properties("MDE") = "T" Then
IsMDE = True
End If
db.Close
Set db = Nothing

Exit_Handler:
Exit Function

Err_Handler:
MsgBox "Error " & Err.Number & ": " & Err.Description
Resume Exit_Handler
End Function
 

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