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.


Software developer living in the Philippines.

Posted in Microsoft Access

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s


Harold Glenn P. Minerva
Software Developer / Tech Enthusiast
Living in the Philippines

View Harold Glenn Minerva's profile on LinkedIn


Software Engineer - Seasonal and Range Trading Software. Magenta Trader is a powerful stock market visualization software that increases your probability of trading success.

Software Architect and Founder - is a multi-tenant cloud-based Software-as-a-Service (SaaS) business app that caters to micro, small and medium trading businesses.

CTO and Co-Founder - We give your company the leverage by providing innovative software solutions products such as Point-of-Sales (POS), Financial Information System (FMIS), Payroll and DTR (HRIS), and many more.

%d bloggers like this: