G
Gordon Jones
I have posted questions the past few days about my inability to get the F1
key to call out my help file (CBW5Help.chm). Operating on instructions from
Microsoft Knowledge Base Q271390, I followed their instructions to create a
module and macro. I couldn't get the F1 to work, but did see how to use the
module to enable a "Help Button" to invoke the fixing function "HelpEntry()".
I posted a new release with my program’s update yesterday which included my
new CBW5Help.chm, and asked for feedback on it. The very first one, using
XP/Access 2002 said neither the F1 nor the help button worked. I’ve been at
this since about 0230 this morning, and have tried it on three machines using
Access 2002 and 2003.
The code you distributed from Microsoft does several things:
· It defines 3 functions.
o Public Function HelpEntry() selects either your own hard coded
default FormHelpFile and FormHelpID or those belonging to the
(curForm.ActiveControl.Properties("HelpcontextId"))
o Public Function Show_Help(HelpFileName As String, MycontextID As
Long) gets the file name and ID from HelpEntry. It prepares a request to the
third function, based on whether the ID it receives from HelpEntry is zero or
not. In my case, there is never a zero, so calls on the third function as
follows:
HtmlHelp(Application.hWndAccessApp, HelpFileName, HH_HELP_CONTEXT,
MycontextID) . This function returns a long integer giving the results of the
running of HtmlHelp, stored in variable “hwindHelpâ€.
In my case the 3 input variables are “CBW5Help.chmâ€, 15, and 10045.
o The third is: Declare Function HtmlHelp Lib "hhctrl.ocx" Alias
"HtmlHelpA" _
(ByVal hwndCaller As Long, ByVal pszFile As String, _
ByVal uCommand As Long, ByVal dwData As Long) As Long
This function is obviously called from within Access. I can only surmise
that it does the heavy lifting after it gets the HH type data from HelpEntry
and Show_Help.
· It also contains instructions to create a Macro named AutoKeys,
and defines the {F1} key as one that executes code and the code is contained
in the function HelpEntry().
When I execute my program on my development Vista machine using Access 2002,
and I press the Help Button that calls HelpEntry(), I get the return
hwindHelp value set at 920344, and the help file opens to the proper place.
When I execute it on a laptop running Vista, using either Access 2002 or
Access 2003, I press the Help Button that calls HelpEntry(), I get the return
hwindHelp value set at 0, and the help file does not open.
When I execute it on an older desktop XP machine, using Access 2002, I press
the Help Button that calls HelpEntry(), I get the return hwindHelp value set
at 0, and the help file does not open.
I am at the limit of what I can do to tie this down. I have repackaged my
program to include a Shortcut directly to the CBW5Help.chm. It seems to open
in all my environments. I am also trying to package a .pdf file just in case
the .chm doesn’t work in users’ environments.
Can anyone help me understand where and why the F1 isn't working, and why
the Help Button doesn't work except on my development machine?
I'd certainly appreciate any leads, and can furnish anyone with the source
codes if that would help.
key to call out my help file (CBW5Help.chm). Operating on instructions from
Microsoft Knowledge Base Q271390, I followed their instructions to create a
module and macro. I couldn't get the F1 to work, but did see how to use the
module to enable a "Help Button" to invoke the fixing function "HelpEntry()".
I posted a new release with my program’s update yesterday which included my
new CBW5Help.chm, and asked for feedback on it. The very first one, using
XP/Access 2002 said neither the F1 nor the help button worked. I’ve been at
this since about 0230 this morning, and have tried it on three machines using
Access 2002 and 2003.
The code you distributed from Microsoft does several things:
· It defines 3 functions.
o Public Function HelpEntry() selects either your own hard coded
default FormHelpFile and FormHelpID or those belonging to the
(curForm.ActiveControl.Properties("HelpcontextId"))
o Public Function Show_Help(HelpFileName As String, MycontextID As
Long) gets the file name and ID from HelpEntry. It prepares a request to the
third function, based on whether the ID it receives from HelpEntry is zero or
not. In my case, there is never a zero, so calls on the third function as
follows:
HtmlHelp(Application.hWndAccessApp, HelpFileName, HH_HELP_CONTEXT,
MycontextID) . This function returns a long integer giving the results of the
running of HtmlHelp, stored in variable “hwindHelpâ€.
In my case the 3 input variables are “CBW5Help.chmâ€, 15, and 10045.
o The third is: Declare Function HtmlHelp Lib "hhctrl.ocx" Alias
"HtmlHelpA" _
(ByVal hwndCaller As Long, ByVal pszFile As String, _
ByVal uCommand As Long, ByVal dwData As Long) As Long
This function is obviously called from within Access. I can only surmise
that it does the heavy lifting after it gets the HH type data from HelpEntry
and Show_Help.
· It also contains instructions to create a Macro named AutoKeys,
and defines the {F1} key as one that executes code and the code is contained
in the function HelpEntry().
When I execute my program on my development Vista machine using Access 2002,
and I press the Help Button that calls HelpEntry(), I get the return
hwindHelp value set at 920344, and the help file opens to the proper place.
When I execute it on a laptop running Vista, using either Access 2002 or
Access 2003, I press the Help Button that calls HelpEntry(), I get the return
hwindHelp value set at 0, and the help file does not open.
When I execute it on an older desktop XP machine, using Access 2002, I press
the Help Button that calls HelpEntry(), I get the return hwindHelp value set
at 0, and the help file does not open.
I am at the limit of what I can do to tie this down. I have repackaged my
program to include a Shortcut directly to the CBW5Help.chm. It seems to open
in all my environments. I am also trying to package a .pdf file just in case
the .chm doesn’t work in users’ environments.
Can anyone help me understand where and why the F1 isn't working, and why
the Help Button doesn't work except on my development machine?
I'd certainly appreciate any leads, and can furnish anyone with the source
codes if that would help.