Access form - want to use html help - api (1 Viewer)

henryihunter1954

Registered User.
Local time
Today, 13:09
Joined
Mar 2, 2016
Messages
89
I have an access database that records data entry.
On each form, I'd like to provide HELP...giving a description of how to use that particular screen.
I have HTML HELP, a button on each form that connects to this program.
I want to make it context - sensitive, pulling up that particular form.

Looking for suggestions as to how this is done.
So far, I don't feel that I fully understand what needs to be done.

I don't want a text pop-up. I just want the full form to be displayed once the button (click) is pressed.

Please help and thank you in advance.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 04:09
Joined
May 7, 2009
Messages
19,230
an alternative approach is to use
an MS Access Form, instead of external
program.

create a table, say tblHelp, with 2 fields:

ContextID (long)
Help (Long text)

fill this table with unique ContextID
and the text you want to display as Help.


create a form (frmHelp) against this table (single record, pop-up).
this will be the pop-up Help file.

next, on the Form that you like to put a Help system, set its
Help Context ID (Property->Other) to corresponding
ContextID in tblHelp.
set it's Keypreview property to Yes (Property->Event).

on the form's On Key Down Event, put this code:

Code:
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
    Dim idCount As Long
    If KeyCode = vbKeyF1 Then
        KeyCode = 0
	' check if there is corresponding help
	idCount = DCount("*","tblHelp", "ContextID=" & Nz(Me.HelpContextID, 0))
	If idCount=0 Then
		Msgbox "Help not available"
	Else
        	DoCmd.OpenForm "frmHelp", acNormal, , "ContextId=" & Me.HelpContextId
	End If
    End If
        
End Sub
 

henryihunter1954

Registered User.
Local time
Today, 13:09
Joined
Mar 2, 2016
Messages
89
arnelgp:

Thank you for your suggestion. I would like to try this procedure and see if it works.
The idea had briefly came to mind about allowing the HELP program/files to come from Access but I had no clue as to how to do it.
I am going to try this over the weekend and see how it goes.

Thank you for a quick response and good instructions.:)
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 21:09
Joined
Jul 9, 2003
Messages
16,280
I do something similar to arnelgp... I could never understand having a separate help system for MS Access, it's so simple to do with a table and a form! I use a few more fields in my table than arnelgp because I allow the user to make their own comments. I get the system to email me when they've made a comment, so that I get a heads up of a possible issue.

I haven't done this yet, but I've been thinking about it. It would be possible to add a URL pointing to a YouTube video which would show the user how to operate certain functionality. Really, if you go with a help system based on a table and a form, then your options on how you provide your help are practically unlimited...
 

Ranman256

Well-known member
Local time
Today, 16:09
Joined
Apr 9, 2015
Messages
4,337
I too have bookmarked contextual help files as .html.
i just open the file using this code. This code opens any file in its native application.

paste this code into a module. Then it will open ANY file via its extension....
.pdf files will open in acrobat,
.doc files in word
etc

USAGE:
OpenNativeApp "c:\folder\file.html#NewRecs" 'opens in web browser at the bookmark
or
OpenNativeApp field 'opens item in field in native app


Code:
Option Compare Database
Option Explicit

Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpszOp As String, ByVal lpszFile As String, ByVal lpszParams As String, ByVal lpszDir As String, ByVal FsShowCmd As Long) As Long
Private Declare Function GetDesktopWindow Lib "user32" () As Long
Const SW_SHOWNORMAL = 1
Const SE_ERR_FNF = 2&
Const SE_ERR_PNF = 3&
Const SE_ERR_ACCESSDENIED = 5&
Const SE_ERR_OOM = 8&
Const SE_ERR_DLLNOTFOUND = 32&
Const SE_ERR_SHARE = 26&
Const SE_ERR_ASSOCINCOMPLETE = 27&
Const SE_ERR_DDETIMEOUT = 28&
Const SE_ERR_DDEFAIL = 29&
Const SE_ERR_DDEBUSY = 30&
Const SE_ERR_NOASSOC = 31&
Const ERROR_BAD_FORMAT = 11&

Public Sub OpenNativeApp(ByVal psDocName As String)
Dim r As Long, msg As String

r = StartDoc(psDocName)
If r <= 32 Then
    'There was an error
    Select Case r
        Case SE_ERR_FNF
            msg = "File not found"
        Case SE_ERR_PNF
            msg = "Path not found"
        Case SE_ERR_ACCESSDENIED
            msg = "Access denied"
        Case SE_ERR_OOM
            msg = "Out of memory"
        Case SE_ERR_DLLNOTFOUND
            msg = "DLL not found"
        Case SE_ERR_SHARE
            msg = "A sharing violation occurred"
        Case SE_ERR_ASSOCINCOMPLETE
            msg = "Incomplete or invalid file association"
        Case SE_ERR_DDETIMEOUT
            msg = "DDE Time out"
        Case SE_ERR_DDEFAIL
            msg = "DDE transaction failed"
        Case SE_ERR_DDEBUSY
            msg = "DDE busy"
        Case SE_ERR_NOASSOC
            msg = "No association for file extension"
        Case ERROR_BAD_FORMAT
            msg = "Invalid EXE file or error in EXE image"
        Case Else
            msg = "Unknown error"
    End Select
'    MsgBox msg
End If
End Sub

Private Function StartDoc(psDocName As String) As Long
Dim Scr_hDC As Long

Scr_hDC = GetDesktopWindow()
StartDoc = ShellExecute(Scr_hDC, "Open", psDocName, "", "C:\", SW_SHOWNORMAL)
End Function
 

isladogs

MVP / VIP
Local time
Today, 21:09
Joined
Jan 14, 2017
Messages
18,214
And just to add my voice to this....

I use both the system suggested by arnelgp / Tony & that proposed by ranman.
Both are easy to implement & both work well.

By contrast trying to get the html help working is horribly complex - I tried it & gave it up as a bad job.

I was half hoping you'd persevere with it then post your solution for everyone else to benefit :D
However my advice would be ... don't bother - use one of the methods suggested earlier
 

henryihunter1954

Registered User.
Local time
Today, 13:09
Joined
Mar 2, 2016
Messages
89
Thank you arnelgp, Uncle Gizmo, Ranman256, and ridders.
I've read each posting and willing to give it the old college try.

Ridders, I kinda, sorta want to persevere but tired to getting one thing done then another error message pops up. Slowly trying to get it to work. But....

I'm going to follow your suggestions.
(in the background I'll keep plugging away and testing HTML HELP ...:banghead:)

Thank you all for your help. This is the best place to get assistance.
You all are professional and sometimes rather witty. I can appreciate that.

Thanks again.
 

Gasman

Enthusiastic Amateur
Local time
Today, 21:09
Joined
Sep 21, 2011
Messages
14,265
I could never understand having a separate help system for MS Access,

I believe is was a 'common' system for a few of their products, Foxpro being another one, so you can understand one system being optimum for multiple products.?
 

henryihunter1954

Registered User.
Local time
Today, 13:09
Joined
Mar 2, 2016
Messages
89
TO arnelgp, Uncle Gizmo, Ranman256, and ridders.
I gave it all that I could.
I was working on using the HTML Workshop Help.
The one thing that I tried was creating a new project for each topic and using the same format, just changing the topic each time. The only disadvantage was that with each time I did that, I added 3 megabytes of data to the Help system. But it does work.
So, instead of adding a few lines of code, I was adding a new system each time.
I know, I know, you all have to be shaking your heads for using such a programming strategy.
But, it does work.
I wanted you all to know that it was not a day that I didn't think of what you all suggestions were and your expertise was greatly appreciated.
So, at this time, I want to say thanks to all of you.
All of you are great. Hoping to be as good and as helpful as you guys are.
To you all.....THANKS so much.
 

sxschech

Registered User.
Local time
Today, 13:09
Joined
Mar 2, 2010
Messages
792
This site has forms and code to do a help system within access.
http://www.projectperfect.com.au/microsoft-access-sample-8.htm

Initially, modified my copy to bring up help contextually when user made a selection on a form. However, some of the actions on the form require no user intervention, so the help menu could not be displayed in those situations. Instead, I further modified it so that there is a button on the main form which opens the help menu and then user selects the topic to get help on. Ironically, after all that, the user decided to use Word to write up all the help instructions and print them out, so it was never fully implemented.
 

sxschech

Registered User.
Local time
Today, 13:09
Joined
Mar 2, 2010
Messages
792
I have attached a stripped down file of my modified form version with a few sample records. Since initial request was to be able to add/edit information directly, the one form does both the viewing and editing. It has rich text so can use bold, highlights and colors as needed.
 

Attachments

  • FormHelpViewer.accdb
    680 KB · Views: 74

Users who are viewing this thread

Top Bottom