Results 1 to 3 of 3
  1. #1
    Girraffa is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Posts
    32

    Question Make image control invisible in report when no image attached

    Hello folks,


    I have a report with an image control in its detail section. The report is based on a query (see image at bottom) that joins two tables of largely qualitative data on basic data as well as incidents for individual animals, so the detail section of the report is just info on one animal. Some of the records have photos associated with them and some do not, and I am wondering if it is possible to hide that photo control when there is no image? Here's the control:
    Click image for larger version. 

Name:	ImageProperties.JPG 
Views:	15 
Size:	267.0 KB 
ID:	32845

    I have tried this:
    Code:
    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    If IsNull(Me.fraPhotos) = True Or Me.fraPhotos = "" Then
        Me.fraPhotos.Visible = False
        Me.lblPhotos.Visible = False
    Else
        Me.fraPhotos.Visible = True
        Me.lblPhotos.Visible = True
    End If
    End Sub
    But it does not work. thanks for any advice or info!

    Here's the general idea of the query:
    Click image for larger version. 

Name:	ReportQueryDesign.JPG 
Views:	15 
Size:	106.8 KB 
ID:	32844

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Just tested. When there is no image, nothing shows, not even an outline, with BorderStyle Transparent. No code.

    Why bother with a label that only says "Photo(s)". Don't insult users, it's obvious it's a photo. Delete the label.

    However, the code should work but only for PrintPreview or direct to printer, not ReportView.

    Try: If IsNull(Me![Photo(s)]) Then

    Advise not to use punctuation/special characters (underscore only exception) in naming convention. Also good you are not using spaces.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Girraffa is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Posts
    32
    June,
    Thanks! I set the border to transparent and made the border transparent, perfect. As a side note, this is not the first time I've been trying to do something that turns out to simply not work in ReportView, seems like an odd quirk? I wonder why. Probably beyond my ken.
    Thanks again!

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

Similar Threads

  1. Replies: 5
    Last Post: 05-12-2016, 06:08 AM
  2. Displaying attached image in form
    By Tectu in forum Forms
    Replies: 4
    Last Post: 08-08-2015, 04:29 PM
  3. Replies: 3
    Last Post: 07-13-2015, 12:07 PM
  4. Replies: 3
    Last Post: 04-25-2015, 07:41 AM
  5. send email with attached image in body
    By trevor40 in forum Programming
    Replies: 5
    Last Post: 02-14-2014, 01:17 AM

Tags for this Thread

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