473,394 Members | 1,739 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Open Custom Help

21
Two related issues:
1.
I would like to place a button on my form to open the helpfile that was set on form load. I cannot find the syntax for opening the helpfile from a button on a form.

'sets help file on form load
Private Sub Form_Load()
Form.Helpfile = CurrentProject.Path & "\helpfile.chm"
end sub

2.
If a user opens the form that has this helpfile set, the microsoft access help will open if the user clicks F1 prior to clicking on any controls of the form. Is there any way around this so that the set helpfile opens if the user clicks F1 prior to clicking on the form?
Feb 27 '08 #1
2 2506
ADezii
8,834 Expert 8TB
Two related issues:
1.
I would like to place a button on my form to open the helpfile that was set on form load. I cannot find the syntax for opening the helpfile from a button on a form.

'sets help file on form load
Private Sub Form_Load()
Form.Helpfile = CurrentProject.Path & "\helpfile.chm"
end sub

2.
If a user opens the form that has this helpfile set, the microsoft access help will open if the user clicks F1 prior to clicking on any controls of the form. Is there any way around this so that the set helpfile opens if the user clicks F1 prior to clicking on the form?
You can Open a Help File (*.chm), or any File for that matter, simply based solely on its Extension. Follow these 3 Steps:
  1. Actual code to Open the Help File.
    Expand|Select|Wrap|Line Numbers
    1. Dim blnRetVal As Boolean
    2. blnRetVal = Execute_Program(CurrentProject.Path & "\Helpfile.chm", "", "")
  2. Declaration in Standard Code Module.
    Expand|Select|Wrap|Line Numbers
    1. Declare Function ShellExecute Lib "shell32.dll" _
    2. Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, _
    3. ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
  3. Public Function, with extensive Error Checking code, so that this functionality can be used anywhere in your Application.
    Expand|Select|Wrap|Line Numbers
    1. Public Function Execute_Program(ByVal strFilePath As String, _
    2.     ByVal strParms As String, ByVal strDir As String) _
    3.     As Boolean
    4.  
    5. 'run program ' <R6>
    6. Dim hwndProgram As Integer
    7. hwndProgram = ShellExecute(0, "Open", strFilePath, strParms, strDir, 3)     '3 ==> Show Maximized
    8.  
    9. 'evaluate errors (if any)
    10. Select Case (hwndProgram)
    11.   Case 0
    12.     MsgBox "Insufficent system memory or corrupt program file."
    13.       Execute_Program = False
    14.         Exit Function
    15.   Case 2
    16.     MsgBox "File not found."
    17.       Execute_Program = False
    18.         Exit Function
    19.   Case 3
    20.     MsgBox "Invalid path."
    21.       Execute_Program = False
    22.         Exit Function
    23.   Case 5
    24.     MsgBox "Sharing or Protection Error."
    25.       Execute_Program = False
    26.         Exit Function
    27.   Case 6
    28.     MsgBox "Seperate data segments are required for each task."
    29.       Execute_Program = False
    30.         Exit Function
    31.   Case 8
    32.     MsgBox "Insufficient memory to run the program."
    33.       Execute_Program = False
    34.         Exit Function
    35.   Case 10
    36.     MsgBox "Incorrect Windows version."
    37.       Execute_Program = False
    38.         Exit Function
    39.   Case 11
    40.     MsgBox "Invalid program file."
    41.       Execute_Program = False
    42.         Exit Function
    43.   Case 12
    44.     MsgBox "Program file requires a different operating system."
    45.       Execute_Program = False
    46.         Exit Function
    47.   Case 13
    48.     MsgBox "Program requires MS-DOS 4.0."
    49.       Execute_Program = False
    50.         Exit Function
    51.   Case 14
    52.     MsgBox "Unknown program file type."
    53.       Execute_Program = False
    54.         Exit Function
    55.   Case 15
    56.     MsgBox "Windows program does not support protected memory mode."
    57.       Execute_Program = False
    58.         Exit Function
    59.   Case 16
    60.     MsgBox "Invalid use of data segments when loading a second instance of a program."
    61.       Execute_Program = False
    62.         Exit Function
    63.   Case 19
    64.     MsgBox "Attempt to run a compressed program file."
    65.       Execute_Program = False
    66.         Exit Function
    67.   Case 20
    68.     MsgBox "Invalid dynamic link library."
    69.       Execute_Program = False
    70.         Exit Function
    71.   Case 21
    72.     MsgBox "Program requires Windows 32-bit extensions."
    73.       Execute_Program = False
    74.         Exit Function
    75.   Case Else
    76. End Select
    77.   'All is well if we get to this point
    78.   Execute_Program = True
    79. End Function
Feb 28 '08 #2
sconard
21
Thanks. Very nice bit of code and useful for many things.
What would be preferable is to open the help page associated with the form with some call. This allows the help to open within access and not force user to close separate window. In addition it uses the default helpfile set for the form which is already defined.

I also still do not know how to have the set helpFile for the form open with an F1 depress prior to clicking on a control on the form.
Feb 28 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Clavien Matthieu | last post by:
I've added a help file in the Dynamic help box of VS.NET 2003, but I can't get it when I look for it in the Index box. Is that possible to include my new help file in the list of the indexes?
3
by: Bob Darlington | last post by:
When I press F1 in print preview, I get the following error message for some (but not all) reports: 'The expression on Key Down you entered as the event property setting, produced the following...
0
by: feng | last post by:
Hi, Does anyone use the Custom Help Builder successfully? I am running VS.Net 2003 and Windows 2000 pro and I just can't make the CHB working. What happens is that I can see the icon from the...
0
by: Progalex | last post by:
Hi, I'd like to create my own Help 2.0 viewer in VB.NET code. Until now, I've discovered that there is the VsHelp COM component that can be added as a new reference in a project for interfacing...
5
by: Yoshitha | last post by:
Hi I am developing a C#.Net windows application for my project. In that project I have an IDE to work on. The application is similar to Adobe Photoshop. My requirement is as follows. 1) I must...
1
by: Yoshitha | last post by:
Hi I am developing a C#.Net windows application for my project. In that project I have an IDE to work on. The application is similar to Adobe Photoshop. My requirement is as follows. 1) I must...
1
by: mattc66 via AccessMonster.com | last post by:
Hi All, I am going to use easy help to create my hlp files. I want to just have a button on my form that says HELP. I would like to then set it up so that I open the .hlp file. What would my...
1
jamjar
by: jamjar | last post by:
I wish to add a command button to my forms to allow users access to the custom help file I am developing. (They can use F1, or the menu, but I think having a button where appropriate will encourage...
6
rcollins
by: rcollins | last post by:
I want to make a help file where all of the help info is in a table. The fields would be ID, Help and Description. I want it to work so when I click on button called Command 22, that it pulls up the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.