Results 1 to 4 of 4
  1. #1
    bilalo is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2019
    Posts
    107

    Image control in report

    I have a report with a logo on its top.
    When the logo has no picture linked to it, I want the report to be printed without a blank space on its top.
    The image control does not have a "can shrink" property, I tried to change programmatically its visibility or its width and height but didn't work.
    Any idea?


    I

  2. #2
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,784
    Post your code attempt and please use code tags (# on posting toolbar). State what view you're trying to do this in. Some events are not available to certain views.
    Or take a crack at setting the size of the control but don't forget that you have to resize the section that it's in as well.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    bilalo is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2019
    Posts
    107
    Quote Originally Posted by Micron View Post
    Post your code attempt and please use code tags (# on posting toolbar). State what view you're trying to do this in. Some events are not available to certain views.
    Or take a crack at setting the size of the control but don't forget that you have to resize the section that it's in as well.
    My report has no report header, it starts with a group header that includes the logo, I tried to change the visibility and the (width/Height to zero) on (Report_Open, GroupHeader_Print, Detail_Print).
    My current solution is to create two similar reports, one with logo and another without logo, and I open the corresponding report after checking if there is a picture or not.

    Is there a better alternative?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,898
    How are logo images loaded, where are they stored?

    You still have not provided attempted code as requested. If you want to provide db for analysis, follow instructions at bottom of my post.

    I have code that sets image size if no image available. Images are in Detail section but expect should be adaptable to other sections.
    Code:
    Option Compare Database
    Option Explicit
    Dim lngImgHt As Long
    
    Private Sub Report_Load()
    lngImgHt = Me.Image82.Height
    End Sub
    
    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    'This line used if image is in Attachment field
    'If IsNull(DLookup("Att.FileData", "Umpires", "UmpID='" & Me!UmpID & "'")) Then
    
    If IsNull(Me!Image) Then
        Me.Image82.Height = 0
        Me.Detail.Height = 0
    Else
        Me.Image82.Height = lngImgHt
    End If
    End Sub
    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.

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

Similar Threads

  1. Replies: 6
    Last Post: 09-18-2020, 09:06 PM
  2. Replies: 5
    Last Post: 07-10-2020, 12:41 PM
  3. Replies: 2
    Last Post: 03-14-2018, 11:10 AM
  4. Replies: 3
    Last Post: 05-14-2015, 01:07 PM
  5. Replies: 3
    Last Post: 04-25-2015, 07:41 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