In this tutorial you will learn how to use the ShellExecute Function.
You can use the Windows API ShellExecute() function to start the application associated with a given document extension without knowing the name of the associated application.
The result is the file opening given it's Default Program associated.
VBA
In the Database add a Module, then you could add the following in the Click Event.
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
Public Sub ShellExec(FileToOpen As String, Optional Params As String = "", _
Optional DefaultDir As String = "", Optional ShowHow As Long = 1)
ShellExecute 0, "OPEN", FileToOpen, Params, DefaultDir, 1
End Sub
In a Form add a COMMAND BUTTON control and rename it "cmdShellExecute", then you could add the following in the Click Event.