MS Access: Browser Based Help from a button on your form

You can import the required module mOpenHyperLink from the Access demo database which you can download from here:

Calling the opening of a html page on a browser is easy. In it's most primitive form you only need to call the OpenHyperLink procedure as in the downloaded database module mOpenHyperLink. This in turn will call the windows API Function ShellExecute  Lib "shell32.dll" , that's all. The code below is optional. It has the advantage that you don't have to include the full path to your topic page each time. In addition it shows how to specify the url in case of file server versus web server, and gives the correct direction of the slash as part of the path.

  1. Import module mOpenHyperLink from the downloaded database.
  2. By default the help opens from the file server. If you want to open from the Internet, change the line
    Sub  MyOpenHyperlink strTopicPage  As String , Optional bOnTheInternet  As Boolean )
    Sub  MyOpenHyperlink(strTopicPage  As   String , Optional bOnTheInternet  As Boolean = True )
  3. In addition, you will need to specify the folder on the web server you will be using. Replace the http://... part. 
     If bOnTheInternet  Then strHTMLfilesFolder = ""
  4. Open the form you want to add the help button to in Design mode
  5. Add a [Help] button to a form
  6. Set the button property name to 'cmdHelp'
  7. Right-click on the newly created button
  8. Select 'Build Event'
  9. Select Code Builder and click OK
  10. The VB editor opens with Private Sub 'cmdHelp_Click() ... End Sub inserted
  11. Insert code so that the result looks like below one of below:

Private Sub cmdHelp_Click()
    MyOpenHyperlink "help.htm"
End Sub


Other ways to call MyOpenHyperlink:

  • MyOpenHyperlink "Add_code_to_activate_help.htm"
    opens that topic page. If the appropriate javascript code (from quick part JsOpenInFrame) is included, it will automatically open the frame page help.htm so that navigation features are made available.
  • MyOpenHyperlink "help.htm?Add_code_to_activate_help.htm"

Private Sub  cmdHelpInternet_Click()
    MyOpenHyperlink "help.htm?BrowserBasedHelp_frm.htm",  True
End Sub

The http address is specified in MyOpenHyperlink
MS Access: starting help from code