Person's picture in report

  • Thread starter Thread starter Kevin Witty
  • Start date Start date
K

Kevin Witty

I think I've followed all the instructions to have a person's
picture print via a filename link (in the table) in an Access
report, but so far it's utterly failing. Can anyone point me to the
right way to do this?

(I've inserted a bound object frame with the ControlSource set to
the field name in the query which points to the file. MS Help is
more than a little confusing about what the Class and other
properties should be, and I have tried various combinations, so far
with no success. Can anyone help?)

Thanks,

Kevin
 
Hi Kevin

Make a plain textbox, txtPhotoFile, with its ControlSource set to the
filename field. Make it invisible.

Next add an Image control. It's easiest to appease the wizard by selecting
any old file, then afterwards you can set PictureType to Linked and delete
the filename from the Picture property. Change its Name to imgPhoto, and
set the SizeMode to Zoom.

Now, create an OnFormat event procedure for the section containing the image
control. Add the following code:
imgPhoto.Picture = txtPhotoFile

--
Good Luck!
Graham Mandeno [Access MVP]
Auckland, New Zealand

Return mail address is invalid in a vain attempt to reduce spam.
Feedback is welcome at: (e-mail address removed)
Please post new questions or followups to newsgroup.
 
HI, Graham -

Finally got it to work. Now the next trick is finding the code (and
the camera) which will automatically take a snapshot and stick the
filename into the table! Any suggestions? I'm using a Logitech
webcam now, and I've got to pop to one screen to take the picture
and to another screen to save it, and then come back to Access.

Thanks,

Kevin
 
Hi Kevin

The only suggestion I have you might like to consider is saving the pictures
with the ID (primary key) of that person's record in the database. Then you
can do away with the filename field altogether, and your code becomes:

imgPhoto.Picture = strPathToPhotos & PersonID & ".jpg"

You could define strPathToPhotos as a constant, or store it in a table, or
in a registry setting, or you could always make it a subfolder of the
database location and say:

strPathToPhotos = CurrentProject.Path & "\Photos\"

--
Good Luck!
Graham Mandeno [Access MVP]
Auckland, New Zealand

Return mail address is invalid in a vain attempt to reduce spam.
Feedback is welcome at: (e-mail address removed)
Please post new questions or followups to newsgroup.
 
Back
Top