Solved

Microsoft Access Report (Image Control Issue)

Posted on 2013-06-26
2
313 Views
Last Modified: 2013-06-26
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
Comment
Question by:Ei0914
  • 2
2 Comments
 

Author Comment

by:Ei0914
ID: 39280109
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
 

Accepted Solution

by:
Ei0914 earned 0 total points
ID: 39280124
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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
File.Search issue 8 32
Error can't find table ?? 5 25
SetProperty Foreground Colour 5 15
How open a file when clicking on a text field 7 20
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question