Results 1 to 7 of 7
  1. #1
    Bronze Lounger
    Join Date
    Feb 2001
    Location
    Escondido, California, USA
    Posts
    1,458
    Thanks
    0
    Thanked 1 Time in 1 Post

    Printing Pictures (Access 2003)

    I have a data base with a field that contains a link to a picture file. What would be a recommended way to print the associated picture with the other data for each record?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Printing Pictures (Access 2003)

    In Access 2003 and before, the best way to handle images is to store the path and filename in a text field, and to use code to display the images in forms and reports. The attachment to <post#=296892>post 296892</post#> demonstrates how to do this.

  3. #3
    Bronze Lounger
    Join Date
    Feb 2001
    Location
    Escondido, California, USA
    Posts
    1,458
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Printing Pictures (Access 2003)

    I have the following code in the Report, but when I run it I get a "Object doesn't support this property, method." error. Any idea what's going on here? In my case I'm not storing the entire image path in the field Photo, just the image file name. I hope the "CurrentProject.path ..." code will work. I used a bound object (imgPicture) place holder for the picture -- is this correct?

    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    On Error GoTo Err_Sub
    If IsNull(Photo) Then
    [imgPicture].Visible = False
    [imgPicture].Picture = ""
    Else
    [imgPicture].Visible = True
    [imgPicture].Picture = CurrentProject.path & "Pictures" & [Photo]
    End If
    Exit Sub
    Err_Sub:
    If Err = 2220 Then
    [imgPicture].Visible = False
    [imgPicture].Picture = ""
    Else
    MsgBox Err.Description, vbExclamation
    End If
    End Sub

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Printing Pictures (Access 2003)

    You should use an (unbound) Image control instead of a bound control.

  5. #5
    Bronze Lounger
    Join Date
    Feb 2001
    Location
    Escondido, California, USA
    Posts
    1,458
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Printing Pictures (Access 2003)

    I hate to be a pest, but I'm running into one more problem. When attempting to add the unbound object it requests the object type. Among the types listed is bitmap, but not jpg, and I'm at a loss how to register the jpg type.

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Printing Pictures (Access 2003)

    Don't use an unbound OLE control, but use the Image control instead. It'll prompt you to select a picture. You can pick any one, then clear the Picture property.
    Attached Images Attached Images
    • File Type: png x.png (5.7 KB, 0 views)

  7. #7
    Bronze Lounger
    Join Date
    Feb 2001
    Location
    Escondido, California, USA
    Posts
    1,458
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Printing Pictures (Access 2003)

    Thanks Hans, That did it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •