473,836 Members | 1,266 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
34 11005
446 Recognized Expert Contributor
I missed that you said the images were stored as ATTACHMENTS. I think our posts crossed.

I'll try that shortly and 'report back'!
Dec 14 '11 #31
Corey Smith
15 New Member
I don't have an issue attaching the database for you guys to look at.

But first, over the last night I was thinking that maybe our approach to accessing the images is what is giving the headaches. Right now we have a separate table linked in that has the category code and the images are stored in an attachment field ... which for whatever reason, we cannot figure out how to check whether it is empty or not using VBA code.

Would the better approach be for us to go the route where we store the paths to where the images are in a text field? Then just check whether that text field is empty, or not?

In other words, if you guys were setting this up ... what approach would you take?

Thanks again for all the help.
Dec 14 '11 #32
446 Recognized Expert Contributor
Hi again
Now that I have added the image as an ATTACHMENT my modified test-bed reports that there is an image present for every record (i.e. the control content is not evaluation to Null) even though there is only an image attached to one.

IsEmpty() did not work either. At least this is now consistant with Corey's findings so are on the same song-sheet as it were.

I want to try a few more things yet

Dec 14 '11 #33
446 Recognized Expert Contributor
Some success!

You can test the AttachmentCount property to see is an image is attached.

Expand|Select|Wrap|Line Numbers
  1. If Me.P2.AttachmentCount = 0 Then
  2.     MsgBox "Image is blank"
  3.     Me.P2.Height = 0
  4. Else
  5.     MsgBox "Image is present"
  6.     Me.P2.Height = 5 * 567
  7. End If
It seems that you can add multiple attachements to one record.

Interestingly the CurrentAttachme nt property seems to return zero whether or not a file is attached (possibly because the control did not have focus)

MSDN details the Attachument properties herehttp://msdn.microsoft.com/en-us/libr...ffice.12).aspx

Corey, in answer to your question "How would you guys do it?", last time I think I embedded the path to the external image, in the image control. The object was always to keep the images outside the database.

I think I have read about Access-2010 being able to store Binary Large Objects (BLOB's) efficiently but I could not find any references when I looked the other night. When I built the test system I ended up using OLE objects bnecause I could not find BLOBs. When I first used OLE (15 yrs ago) it was VERY inefficient, I was told because it embedded bits of the executable required to interprete the linked object. I don't know if is still true (or ever was)

Dec 14 '11 #34
32,584 Recognized Expert Moderator MVP
I would go along with S7's thinking. Storage space is at less of a premium nowadays, but Access databases still have a 2GB limit last I heard. I expect there is still a performance hit with linked images, but the space reduction is quite heavy too. The only real way to tell what suits you best is to suck it and see. I would expect the issues to be performance and size though.
Dec 15 '11 #35

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: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
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: 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: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
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.