Linking Pictures to an entry

B

Brenda Kesler

Hi, I'm an Access novice. Trying to create a database for a non-profit Feline
clinic and adoption facility. In Access XP I was able to create a database
where I could link a name of a cat to a picture (entry type 'hyperlink') and
in the table you click on the name and the picture displays. When I create a
similar table in Access 2003, no picture displays. I get a warning message
that says "Hyperlinks can be harmful to your computer...." and the picture
never opens. Interestingly, if I take my old database and open it in Access
2003, those hyperlinks still work even when I get the same error message. I
have tried to compare all settings in Design view to assure they are the
same, but clearly something is different. Any help greatly appreciated as I
am doing this as a volunteer.

(e-mail address removed)
 
K

Ken Sheridan

An efficient way of including images in a database is to store the paths to
the image files in a simple text field in the table. Then on a form bound to
the table add an Image control and load the picture into it at runtime by
setting the Picture property of the control to the value of the text field in
the form's Current event procedure. The image then displays in the form
rather than shelling out to whatever image software you are using. Its
prudent to hide the image control if you have any records without images or
it will show the image from the previous record, so the code for the form's
Current event procedure would be like this:

If Not IsNull(Me.YourTextField)
Me.YourImageControl.Visible = True
Me.YourImageControl.Picture = Me.YourTextField)
Else
Me.YourImageControl.Visible = False
End If

This only works in single form view BTW, not in a continuous form.

You can do the same in a report. In that case use the detail section's
Print event procedure to load the image. Note that in a report you must have
a text box in the detail section bound to the text field, but it can be
hidden by setting its Visible property to false in its properties sheet.
 

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