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?
2 2506
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: - Actual code to Open the Help File.
-
Dim blnRetVal As Boolean
-
blnRetVal = Execute_Program(CurrentProject.Path & "\Helpfile.chm", "", "")
- Declaration in Standard Code Module.
-
Declare Function ShellExecute Lib "shell32.dll" _
-
Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, _
-
ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
- Public Function, with extensive Error Checking code, so that this functionality can be used anywhere in your Application.
-
Public Function Execute_Program(ByVal strFilePath As String, _
-
ByVal strParms As String, ByVal strDir As String) _
-
As Boolean
-
-
'run program ' <R6>
-
Dim hwndProgram As Integer
-
hwndProgram = ShellExecute(0, "Open", strFilePath, strParms, strDir, 3) '3 ==> Show Maximized
-
-
'evaluate errors (if any)
-
Select Case (hwndProgram)
-
Case 0
-
MsgBox "Insufficent system memory or corrupt program file."
-
Execute_Program = False
-
Exit Function
-
Case 2
-
MsgBox "File not found."
-
Execute_Program = False
-
Exit Function
-
Case 3
-
MsgBox "Invalid path."
-
Execute_Program = False
-
Exit Function
-
Case 5
-
MsgBox "Sharing or Protection Error."
-
Execute_Program = False
-
Exit Function
-
Case 6
-
MsgBox "Seperate data segments are required for each task."
-
Execute_Program = False
-
Exit Function
-
Case 8
-
MsgBox "Insufficient memory to run the program."
-
Execute_Program = False
-
Exit Function
-
Case 10
-
MsgBox "Incorrect Windows version."
-
Execute_Program = False
-
Exit Function
-
Case 11
-
MsgBox "Invalid program file."
-
Execute_Program = False
-
Exit Function
-
Case 12
-
MsgBox "Program file requires a different operating system."
-
Execute_Program = False
-
Exit Function
-
Case 13
-
MsgBox "Program requires MS-DOS 4.0."
-
Execute_Program = False
-
Exit Function
-
Case 14
-
MsgBox "Unknown program file type."
-
Execute_Program = False
-
Exit Function
-
Case 15
-
MsgBox "Windows program does not support protected memory mode."
-
Execute_Program = False
-
Exit Function
-
Case 16
-
MsgBox "Invalid use of data segments when loading a second instance of a program."
-
Execute_Program = False
-
Exit Function
-
Case 19
-
MsgBox "Attempt to run a compressed program file."
-
Execute_Program = False
-
Exit Function
-
Case 20
-
MsgBox "Invalid dynamic link library."
-
Execute_Program = False
-
Exit Function
-
Case 21
-
MsgBox "Program requires Windows 32-bit extensions."
-
Execute_Program = False
-
Exit Function
-
Case Else
-
End Select
-
'All is well if we get to this point
-
Execute_Program = True
-
End Function
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.
Sign in to post your reply or Sign up for a free account.
Similar topics
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?
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
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...
|
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
|
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...
|
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...
|
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...
|
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,...
|
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...
| |