[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 328
  • Last Modified:

Microsoft Access Report (Image Control Issue)

I have a report where some records have links to images and others do no. I would like to automatically resize an Image Control to eliminate white space. I can't seem to find anything. Any ideas?
0
Eileen Murphy
Asked:
Eileen Murphy
  • 2
1 Solution
 
Eileen MurphyIndependent Application DeveloperAuthor Commented:
I tried this and while the resizing works the image appears for all records despite the fact that the PathToImage is blank for many of them:

   Dim FullPath As String
   
    If IsNull(Me.PathToImage) Or Me.PathToImage = "" Then GoTo ExitHere
   
    FullPath = Me.PathToImage

    If Dir([FullPath]) <> Empty Then
        Me.[Image27].Visible = True
        Me.[Image27].Picture = FullPath
        Me.[Image27].Height = 1800
    Else
        Me.[Image27].Visible = False
        Me.[Image27].Height = 0
    End If
    FullPath = ""
0
 
Eileen MurphyIndependent Application DeveloperAuthor Commented:
I'M A BOOB! Duh --

Here's the code that works....

Dim FullPath As String
   
    If IsNull(Me.PathToImage) Or Me.PathToImage = "" Then
        FullPath = ""
    Else
        FullPath = Me.PathToImage
    End If
   
    If Me.PathToImage <> "" Then
        Me.[Image27].Visible = True
        Me.[Image27].Picture = FullPath
        Me.[Image27].Height = 1800
    Else
        Me.[Image27].Visible = False
        Me.[Image27].Height = 0
    End If
    FullPath = ""
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now