INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Access Howto:

Print Linked Images in a Report by AirPro
Posted: 8 Jan 01

How to code:
This code loads a picture from the local or network hard drive into an image control based on a Picture ID stored in a table.

Steps
1. Create a report
2. Add an Image control to the 'Details' section of the report
3. After selecting an image file as required by the image control wizard; delete it and set the image format properties to "linked" and "zoom".

Next double click the Details Section line so the "Detail" Properties box shows.

In the Detail_Format event (near the bottom) click it, so "Event Procedure" shows; then click the "3 dots" button to view the VBA code window

Next paste this line in as shown below

Me!Image(insert image number).Picture = "F:\path to your pictures\" & Me![field on the report that has a unique Picture ID] & ".jpg" (or other specified file type)

Here is an example from my report:

Private Sub Detail1_Format(Cancel As Integer, FormatCount As Integer)
    Me!Image74.Picture = "F:\DIVISION\AQD\Photos\" & Me![PHOTO.PHOTO_ID] & ".jpg"
End Sub

Now when you view the report it should show the associated linked picture for each record.

Back to Microsoft: Access Other topics FAQ Index
Back to Microsoft: Access Other topics Forum

My Archive

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close