Solved

Invoke chm help in access 2007

Posted on 2009-04-03
14
1,064 Views
Last Modified: 2013-11-28
I have created chm help for an access 2007 application and entered the path and help context ID's to the mdb but in Access 2007 the What's This button seems to have been discontinued.

How do I invoke the chm help file in my access program.
0
Comment
Question by:merdeka
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 7
14 Comments
 
LVL 65

Expert Comment

by:rockiroads
ID: 24062896
Ive used .hlp (winhelp) files before not chm and all I had to do was hit F1 on the appropriate place (where context id specified)
Dunno if that is still the case with CHMs?

0
 

Author Comment

by:merdeka
ID: 24062979
Rockiroads,

Apparently it is not with chm files as I have tried that.  My chm help file is in C:\Program Files\MyAppHelp\
and I have opened the file using the path from the Help File property in the Access form so I know the path is good.  

In Access 2003 there used to be a form property called "What's This" that would open the chm help file when the What's This question mark icon was clicked and the field that help was wanted for was clicked.  Now the What's This feature seems to be gone from Access 2007 so I need to know how to call my chm help.

Thanks,
merdeka
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 24063178
ok, gotcha.
Well Im not sure but ms got this site which is supposed to explain where a A2003 item is now in A2007. Ive not gone through it myself but it may help
http://office.microsoft.com/en-us/access/HA102388991033.aspx
0
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 

Author Comment

by:merdeka
ID: 24063482
rockiroads,

I don't see it there.  Maybe its me but my experience with Microsoft help for Access is frustration 95% of the time.

Thanks,
merdeka
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 24064151
yea its crap eh, i clicked the start the guide link and I couldnt go past the first screenshot. Status bar still says waiting for ... and its been 10mins

did u check out the download also? http://office.microsoft.com/en-us/templates/TC102128601033.aspx

I will try search ms to see where it is, otherwise I dont really know
0
 

Author Comment

by:merdeka
ID: 24064537
rockiroads,

I checked the link you provided above but the answer doesn't seem to be there either.  Maybe Microsoft has found that (their) help files are useless so we don't need them anymore.

Thanks,
merdeka
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 24064596
lol, that sounds right.
I havent found anything yet, will look again tomorrow
0
 

Author Comment

by:merdeka
ID: 24081765
rockiroads,

The F1 key won't open MS Access help or my custom help file in design view (i.e. my program form active) - is this normal?.  When I click F1 the mouse pointer momentarily changes to an hourglass then back to a pointer.  The f1 key works in design view and in the code window.

Thanks,
merdeka
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 24081813
My understanding was that if you specify the help file in a form, F1 would be looking for that using the context id's to find the right page but only during runtime.
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 24081816
when I did winhelp pages longtime back (now redundant), this is what I did, set the help file then that help file had id's set. The form would then use one of them id's.
Ive no idea about chm's though. There might be a similar thing
0
 
LVL 65

Accepted Solution

by:
rockiroads earned 500 total points
ID: 24081831
some stuff here, not sure if it will help. I will give it a go tomorrow I think, its late for me now so Im signing off.
http://www.tek-tips.com/viewthread.cfm?qid=324116&page=1
0
 

Author Comment

by:merdeka
ID: 24083021
rockiroads,

I have added help to a number of Access 2003 programs and it was nothing like what is described in the link above.  

In Access 2003 I just added the chm help file contextID in the Other > Help contedt ID field of the form property sheet or the object property sheet and added the path to the chm help file in Help file property of the form and it worked fine.  The difference I can see between Access 2007 and Access 2003 is that Access 2003 had a propery called 'What's this?' which put a question mark in the title bar of the form which you could click and then click on the object in question and the chm help file would open.  

merdeka
0
 

Author Comment

by:merdeka
ID: 24122791
rockiroads,

I tried the code from the link above and the macro from the link above (RoryJakes code and ptPaton modification) but it still doesn't work (please see attached code snippet).  I don't have a contextID of 1001 but I tried it with contextID 1001 and contextID 100 in the code, I do have contextID 100 in my CHM file, but nothing happens when I click the F1 key.

BostonFrog (same article) mentions something about ALIAS and MAP which I don't understand.

Thanks,
merdeka


Option Compare Database
Option Explicit
 
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
 
Const HH_DISPLAY_TOPIC = &H0
Const HH_SET_WIN_TYPE = &H4
Const HH_GET_WIN_TYPE = &H5
Const HH_GET_WIN_HANDLE = &H6
Const HH_DISPLAY_TEXT_POPUP = &HE
Const HH_HELP_CONTEXT = &HF
Const HH_TP_HELP_CONTEXTMENU = &H10
Const HH_TP_HELP_WM_HELP = &H11
 
Public Sub Show_Help(HelpFileName As String, MycontextID As Long)
    'A specific topic identified by the variable context-ID is started in
    'response to this button click.
    Dim hwndHelp As Long
 
    'The return value is the window handle of the created Help window.
    Select Case MycontextID
        Case Is = 0
            hwndHelp = HtmlHelp(Application.hWndAccessApp, HelpFileName, _
                       HH_DISPLAY_TOPIC, MycontextID)
        Case Else
            hwndHelp = HtmlHelp(Application.hWndAccessApp, HelpFileName, _
                       HH_HELP_CONTEXT, MycontextID)
    End Select
End Sub
 
Public Function HelpEntry()
    'Identify the name of the Help file and a possible context-id.
    Dim FormHelpId As Long
    Dim FormHelpFile As String
    Dim curForm As Form
Dim lnghWnd As Long, strHelpFile As String, lngContext As Long
Dim lngRetVal As Long, obj As Object
 
On Error Resume Next
Const conHelpContext = &H1
Set obj = Screen.ActiveForm
 
If Err = 2475 Then
Err = 0
Set obj = Screen.ActiveReport
If Err = 2476 Then
Err = 0
 
End If
End If
 
With obj
lnghWnd = .Hwnd
strHelpFile = .HelpFile
lngContext = .HelpContextId
End With
 
    'Set the curForm variable to the currently active form.
    Set curForm = Screen.ActiveForm
 
    'As a default, specify a generic Help file and context-id. Note that
    'the location of your file may be different.
    FormHelpFile = "C:\Program files\MyTimesheet\CoreTimesheetHelp.chm"
    FormHelpId = 1001
 
    'Check the Help file property of the form. If a Help file exists,
    'assign the name and context-id to the respective variables.
    If curForm.HelpFile <> "" Then
        FormHelpFile = curForm.HelpFile
    End If
    
    If curForm.HelpContextId <> 0 Then
        FormHelpId = curForm.HelpContextId
    End If
 
    'If the Help context-id of the control is not null and greater than
    'zero, assign the value to the variable.
    If Not IsNull(curForm.ActiveControl.Properties("HelpcontextId")) Then
        If curForm.ActiveControl.Properties("HelpcontextId") > 0 Then
            FormHelpId = curForm.ActiveControl.Properties("HelpcontextId")
        End If
    End If
 
    'Call the function to start the Help file, passing it the name of the
    'Help file and context-id.
    Show_Help FormHelpFile, FormHelpId
End Function

Open in new window

0
 

Author Closing Comment

by:merdeka
ID: 31566377
I think the solution might work but it didn't work for me.
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question