How to display patient scanned records

C

charles.kendricks

I have a patient database with about 15,000 patient records. We are
beginning the process of scanning and storing many of the archived
patient records. The scanned documents files are named according to
the patient first and last name, simply firstname_lastname_000x.bmp,
with the 000x being a self incrementing number handled by the scanner
software.

What I want is a command button that will pull up and display all of a
particular patients scanned documents. The patient firstname and
lastname would of course be fields on the form that the command button
would be placed. Any ideas on how I might accomplish this??
 
S

strive4peace

Hi Charles,

try this in the code behind your form:

'~~~~~~~~~~~~~~~~~~~~~~~

Private Function ListScanDocs()

On Error GoTo Proc_Err

Dim mPath As String _
, mFileMask As String _
, mFilename As String _
, s As String

mPath = "c:\data\whatever\"
mFileMask = mPath _
& nz(me.Firstname_controlname,"") & "_" _
& nz(me.Lastname_controlname,"" & "_" _
& "*.bmp"
s = ""

mFilename = Dir(mFileMask)
Do While mFilename <> ""

if len(s) > 0 then s = s & ";"
s = s & mFilename

mFilename = Dir
Loop

me.listbox_controlname.rowsource = s
on error resume next
me.listbox_controlname.requery

Exit Function

Proc_Exit:
Exit Function

Proc_Err:
MsgBox Err.Description, , _
"ERROR " & Err.Number & " ListScanDocs"
'press F8 to step through code and debug
'remove next line after debugged
Stop: Resume
Resume Proc_Exit

End Function
'~~~~~~~~~~~~~~~~~~~~~~~

btw, it would be much better to save your scans as JPG files instead of
BMP files, they will take about 1/10th the space

You will want to call ListScanDocs on the Current event of the form and
also on the AfterUpdate event of your Firstname and Lastname controls

If you are putting the code on a command button, you will want to make
sure first and last name is filled out -- do this at the top of the routine

'~~~~~~~~~~~~~~~~~~~~
if isnull(me.Firstname_controlname) then
msgbox "Need the Patient's First name" _
,, "Cannot show Scanned Documents"
exit Function
end if

if isnull(me.Lastname_controlname) then
msgbox "Need the Patient's Last name" _
,, "Cannot show Scanned Documents"
exit Function
end if
'~~~~~~~~~~~~~~~~~~~~

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top