How to display scanned images from a form

  • Thread starter charles.kendricks
  • Start date
C

charles.kendricks

I have a patient database, but a lot of the old patient records were
scanned and stored previous the development of the database. All of
the scanned image files are named using the patients FirstName_LastName
as the first part of the file name.

What I want to do is to be able to display those scanned images for the
patients from a form which I use to look up other information for the
patients. Of course two of the fields on the form are patient
FirstName and LastName.

I'm sure there must be a fairly straightforward method to accomplish
this, even for a novice such as myself.
 
R

Roger Carlson

You'll want to load each picture into an image control on the form
programmatically. Usually, people store the actual file name in a table,
but if all the images are named consistantly with FirstName_Lastname, and
you are already displaying these fields on the form, you should be able to
build the file name in code as well.

pathname = CurrentProject.Path
Me.ImgControl.Picture = pathname & "\" & Me.FirstName & "_" &
Me.Lastname & ".jpg"

Note: you'll have to change the extention (.jpg) to whatever file format
your image is using. Also replace ImgControl with the actual name of your
Image Control.

On my website (www.rogersaccesslibrary.com), is a small Access database
sample called "Pictures.mdb" which illustrates how to do this.

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 
K

kingston via AccessMonster.com

One way to do this is to store all of the images in one folder (e.g. C:\
PatientPics). In the form with the name fields, insert an image control (in
design mode - add an image box, select a temporary image as the default,
change it to (none) in the properties window, and change the Picture Type to
Linked). Use the form's OnCurrent event to set the control's Picture
property to something like:

Me.ImageControl.Picture = "C:\PatientPics\" & Me.FirstName & "_" & Me.
LastName & ".jpg"
 

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