Solved

Invoke chm help in access 2007

Posted on 2009-04-03
14
1,010 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
  • 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
 

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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

A high-level exploration of how our ever-increasing access to information has changed the way we do our jobs.
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

705 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now