Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2007
    Posts
    72

    Unanswered: Image display in a report not working

    I used the Microsoft support pages called How to display images from a folder in a form, a report or a data access page.
    HTML Code:
    http://support.microsoft.com/default.aspx?scid=kb;en-us;285820
    My image is displaying in the form "StaffDirectory" no problem.
    My references on the form are Forms!StaffDirectory!txtImageName as the form is based on a union query that doesn't include those fields.

    The StaffDirectory form is already open and a link from it takes you to the staff summary page "SummaryForm" which is where the image displays. This is the part that works.

    Then there is a link to open the report for printing.

    For this I used the SaveAs option to save the form as report for printing and changed the code to the following:
    Code:
    Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
    Me!txtImageNote = DisplayImage(Me!ImageFrame, Me!txtImageName)
    End Sub
    as per the microsoft support article.

    All I am getting on the report is the "zapotec"image which is the placeholder.
    The other fields on the report that reference the StaffDirectory form display the persons' name and other details display correctly so the referencing appears to be correct.
    I'm not sure what is going wrong.

    If I haven't explained enough about what I'm doing for you to help, just tell me and I'll ellaborate in the morning.
    I've done this before in a different db and it has worked, the only difference that I didn't have to reference other forms as the form and report had the fields in their control source.

  2. #2
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,424
    Provided Answers: 8
    Try putting the code in the ON Format
    try this

    Private Sub Detail_Format(Cancel As Integer, PrintCount As Integer)
    Me!txtImageNote = DisplayImage(Me!ImageFrame, Me!txtImageName)
    End Sub
    hope this help

    See clear as mud


    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
    VB based on my own environment: vb6 sp5
    ASP based on my own environment: 5.6
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    MYLE
    YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.

  3. #3
    Join Date
    Jul 2007
    Posts
    72
    Thanks, Excellent. I've got the photo in the header so:
    Code:
    Private Sub FormHeader_Format(Cancel As Integer, PrintCount As Integer)
    Me!txtImageNote = DisplayImage(Me!ImageFrame, Me!txtImageName)
    End Sub
    does it for me.

  4. #4
    Join Date
    Mar 2009
    Posts
    10
    I work in 2003 and DisplayImage does not seem to be an option. Does it require a reference? I have followed directions and can print images in a report but only 3 or 4 images per report.

    I have tried the following code on the format event and the print event with the same results.
    Me![ImageFrame1].Picture = Me![ImageFile1]
    Me![ImageFrame2].Picture = Me![ImageFile2]

    where ImageFrame1 and 2 refer to Image controls on the report and ImageFile1 and 2 refer to a text field on the report which is bound to the field in the table containing the path and file name of the image.

    If I filter to:
    3 images then 3 images print
    6 images, then 3 images print (all 6 show on print preview)
    4 images, then 3 or 4 images print (all 4 show on print preview)

    I can't find a pattern when printing to ADOBE but usually it shows from 0-2 images when I send 6.

    Any ideas?

Posting Permissions

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