How to open any generic electronic medical file using Microsoft Access?

To open any type of document using Microsoft Access you will have use the Shell API in windows.  To declare the Shell API, create a public module then paste the code below:

Global Const SW_SHOWNORMAL = 1

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

The next step is just to call the ShellExecute function, see the sample snippet code below:

ShellExecute Me.hwnd, "open", lstDocumentMem, "", strPath, SW_SHOWNORMAL

All you need as parameters are the lstDocumentMem, which is the name of the document, and strPath, which is the path of the document.  Thats it.

Here is an example application using the ShellExecute function:

In the above application the ShellExecute is used to open the medical record of a certain patient.  Medical records may contain file types of different sources like TIF, PDF, Word Doc, etc., you need to have a generic file opener in order to consolidate this files into a one Medical record repository.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s