Results 1 to 6 of 6
  1. #1
    spidge32 is offline Advanced Beginner
    Windows 10 Access 2013 32bit
    Join Date
    Jul 2021
    Posts
    48

    Manage a .jpg file in a report

    I have series of picture files .jpg. I would like these pictures to be printed on a report but the picture object is invisible and formatted to the back unless a picture is found in the picture table.



    My question is how do you make the picture visible when required.

    Cheers

    Bill

  2. #2
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    10,143
    Have not done this, but something comes to mind. If it works when there is a pic, then make sure there's always a pic. When there is no relevant pic, that could be a person silhouette (if you're referring to people images) or even just a single pixel jpg.

    BTW - are you storing these image files in a table as attachments? Not recommended. Better to just use the image path.
    Last edited by Micron; 12-08-2021 at 09:08 PM. Reason: clarification
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    spidge32 is offline Advanced Beginner
    Windows 10 Access 2013 32bit
    Join Date
    Jul 2021
    Posts
    48
    Hi Micron
    The .jpeg files are linked by a image path.
    The problem I have is that the image when required is printed over the top of the fields in the report. So it would have to be invisible until there is a linked jpeg.
    When the report is printed from a file, if the field for a image is not null the image on the report becomes visible and is on top of the other fields.

    The only other way I have thought of is to have a PDF of the image separately and if a PDF is available to also print it at the same time as the normal report.
    This method maybe easier, but I'm trying to save paper.

  4. #4
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    10,143
    I'm not following. You want it to be on top of other controls and obscure the data they hold if there is an image? If there is no image you want the image control to do what?
    The problem now is that the image control goes black and moves behind those controls when there is no image? (I don't see how it can move - it's probably just blending with text).
    Or the image control goes black and obscures the data in those controls (it's not really moving)?

    My question is how do you make the picture visible when required.
    I read that as "when there is an image, it's not showing"- so
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #5
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    2,839
    To hide the image control on the report you would use code like this:
    Code:
    If IsNull(Me.ImagePath) Or Dir(Me.ImagePath) = "" Then 'check if the hidden textbox on the report that contains the path is null or contains invalid path
            Me.ImageFrame.Visible = False
        Else
            Me.ImageFrame.Picture = Me.ImagePath
            Me.ImageFrame.Visible = True
            Me.ImageCaption.Visible = True 'additional label control for image - might not be needed
        End If
    If the report contains multiple records you need to add this code to the Format or Print of the section where the image control is located (probably the Detail section), if only one record then you can just add it to the ReportOpen event.

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  6. #6
    spidge32 is offline Advanced Beginner
    Windows 10 Access 2013 32bit
    Join Date
    Jul 2021
    Posts
    48
    Thank you Vlad, with a bit of work I got your code to do exactly what was required.
    Cheers
    Bill

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 03-03-2017, 09:25 PM
  2. Manage report sections based on list box selection
    By IMACoolClassic in forum Reports
    Replies: 3
    Last Post: 07-26-2016, 03:07 PM
  3. How to manage the manage the input of data?
    By Gambit17 in forum Import/Export Data
    Replies: 4
    Last Post: 07-30-2013, 10:32 AM
  4. Letter Database: How to manage predefined text in a report.
    By lostblue7w in forum Database Design
    Replies: 3
    Last Post: 02-11-2013, 11:42 AM
  5. Replies: 6
    Last Post: 06-26-2011, 03:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums