473,836 Members | 1,540 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Displaying an image conditional on an Access Report

15 New Member
Hello, I am fairly novice with Access in general ... but do have a decent amount of ability with VBA (mostly through Excel, though).

I'm working on a project that is producing a product catalog through an Access Report, and here is what I am stuck on:

There are advertising banners that they would like to display beneath the main group headers for each product category. We plan on storing these image banners into their own table, and connect to the correct one for the category through there.

The thing is, though, that not all categories will have a banner to display.

I'm assuming a simple check to see if an image exists for the current category would take care of whether the image shows or not ... and adjust the group header's height based on that also.

But which event should I put this code in for it to function correctly?
Dec 9 '11 #1
34 11006
32,584 Recognized Expert Moderator MVP
I don't use images much in my work, but wouldn't the most sensible approach be to include the image item in the query by linking the image table in?

Handling the size of the header could be done using code, but I would suggest that is a separate question and should be approached only when the first problem is resolved.
Dec 9 '11 #2
Corey Smith
15 New Member
Definitely worth looking into. Let me give that a run.
Dec 9 '11 #3
32,584 Recognized Expert Moderator MVP
Good attitude. Go for it.

Let us know how you get on with it and we can see about helping if any is still required by then.
Dec 9 '11 #4
Corey Smith
15 New Member
Did as you suggested and added the image field to the query. Worked great.

What I need to figure out now is how to get the section that I have used the image in for the report to not be visible if that image field is NULL.

How do I reference the field so that I can us IsNull on it?
Dec 9 '11 #5
32,584 Recognized Expert Moderator MVP
I'm very pleased that helped.

To answer your follow-up question though, I'd need :
  1. The SQL used for the query.
  2. The name of the field in there which relates to the image.
  3. The control on the report which displays the image.
  4. The name of the section in the report that it's on.
  5. The name of the report itself.

With that I may be able to help you find a way to react to the presence and absence of the picture.
Dec 9 '11 #6
Corey Smith
15 New Member
  1. Expand|Select|Wrap|Line Numbers
    1. SELECT [Catalog Import].Code
    2.      , [Catalog Import].Description
    3.      , [Catalog Import].[Item No]
    4.      , [Catalog Import].ID
    5.      , [Advertising Images].Image
    7. FROM   [Catalog Import]
    8.        INNER JOIN
    9.        [Advertising Images]
    10.   ON   [Catalog Import].Code = [Advertising Images].[Catalog Group Codes];
  2. The field is "Image".
  3. I used the Image control from the report design tab. Please let me know if there's a better way to do this.
  4. Name of the section is GroupHeader1.
  5. Name of the report is "Grocery Section".

Thanks Again!
Dec 9 '11 #7
32,584 Recognized Expert Moderator MVP
Very well answered. Unfortunately I left question #3 a little unclear. Can you tell me the name of the control? I'm sure the type is fine for what you're doing.
Dec 10 '11 #8
446 Recognized Expert Contributor
I did not see the question of 'null' image being resolved.
Usually, making the image height in design view minimal, then making its property Can Grow = Yes, takes care of this.
Dec 11 '11 #9
446 Recognized Expert Contributor
Hi again,
My apologies. Just checked and now confirm that an image control does not have Can Grow/Can Shrink properties. How unfortunate.

That means back to Plan A and changing the height programmaticall y. I would change the height of the image control not the section height (that can Grow or Shrink automatically).

I would try it with the On_Paint event first (they seem to have re-named the On_Format event since Access 2007)

Dec 11 '11 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

by: mar10a | last post by:
I am trying to insert a .gif. file into an Access report - using Insert Picture. The original image is 8X11, but access changes the size to 4X6.5. When I change the size of the image in access is puts white border around it and does not change the actual image. Is there a setting I need to change that would allow access to import at the correct size, or do I need to use another file type besides
by: Mike Turco | last post by:
I have an Access database that holds a catalog and one of the fields contains the HTML for the web page. The HTML code is very simple. I would like to be able to display that HTML output on an access report. Is there some kind of control that I can embed into the report so that I can see that HTML? Thanks, Mike
by: emebohw | last post by:
Hey all, weird problem. I cant seem to get a populated text field that has a hyperlink to work when I output my access report to MS office document image writer file. If I stick a 'label' type field on the report and put a url in there and print as msodiw then the hyperlink works. Anyone ever see this? Also, even on the access report, the hyperlink doesnt work correctly. WTH?
by: Parasyke | last post by:
I have a report that I want to print for a product specification sheet with a photo of the product. I have the photos stored in a separate folder from my Access 2000 database. I have a form that when I choose a product all the info for that product appears on the form appropriately, including the image path (e.g. C:\ABCcompany\Prods\Item894654.jpg). The form's data appears appropriately on the report for that item. How can I place an image...
by: kasthuriii | last post by:
Hai everybody i have a project which includes image.i have to store the image in access table using ole control and i have to display that image in crystal report.The important thing is, i must use ole control for storing the image.please help me. Thank u.
by: Saaima | last post by:
Hi All when I store a picture of size 800*600 pixels in database (SqlServer) field Photo (Image) and load it into crystal report through query by dragging and dropping the field on report it appears well but as its size is too large and when i resize it its resolution become so wrong to can not see image. such as in Employee photo in Employee record Actually i need a passport size photo on report. So i save a picture of this size and get...
by: akabir77 | last post by:
Hi I am using the following code to convert a access report into HTML format and then sending it via email. DoCmd.SendObject _ acSendReport, _ "rptQC-Div-email", _ acFormatHTML, _ rs!email, _ , _
by: NJonge01 | last post by:
Greetings, I've read some great advice on similar topics, just nothing matching exactly what I'm trying I'm pretty close I think on making this work, but note quite there. I want to print a report that basically displays photographs. the photographs are located on a web server viewable from my browser. I want to reference the URL and "pull" them into my report at print time TABLE: In a Table, I have a field defined as Hyperlink. ...
by: blees10 | last post by:
Hi Everyone, I am working on an Access report and the client is asking for nitpicky things so I am working on a way to make this work. I have a couple questions and they are not related. 1. I have a date field which I formatted in the Format properties dd" de "mmmm" de "yyyy. I did this so that the date will display as follows: 02 de Febuary de 2008. This works well, but now I need to change the capitalization of Febuary to lower...
by: dbdb | last post by:
hi, i work with ms. access 2003 i want to display image from a folder to the report. i have read thread in http://bytes.com/topic/access/answers/191611-pictures-access-reports but that's for access 2000 i want to set my image picture property, but there is no picture property when i type "image.p " -> no picture property.
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.