Embedded images in report-records while using SQL in recordsource

Hi, I've got a strange issue where i've been searching for some time without finding a good answer:

I have a database with embedded illustrations which I use to make sparepart lists. The records are all retrieved and nicely ordered inside a report.
In the past worked a lot with queries and this went just fine. Now recently I started to work with VBA to automate and speed up some things.
Now I make reports via SQL with the correct records (just like i had with the integrated queries before in the recordsource), however I noticed, the images are not visible in the reports

I narrowed down and figured out the following:

When I link the recordsource of an (illustrated) report to a query inside the report's properties, the images in my report (which are embedded images per record) are visible.
When however, I use an SQL statement inside the recordsource, which is exactly corresponding to the queries I used before, the images are NOT visible in my report

Does somebody knows what I should do to obtain my images in my reports especially when I want to work with SQL instead of queries (inside my report?)
I really would like to work with SQL as can easily create the correct statements/code in vba...

Thank you!

Post your answer or comment

comments powered by Disqus
Hello, I'm a new user to access and I have a poor knowdledge in scripting with visual basic. After many searches I managed to find this awesome forum where in the future I could learn a lot of stuff about creating "solid" Access Databases.

Due to the fact I'm in the need of a database of the objects I buy/sell in my shop I started creating my own database with Access 2007. Unfortunately the templates available with Access 2007 couldn't provide me much help, so I had to build a database from scratch. I've had a few hard weeks but finally I'm starting to understand many of the things that run an Access Databases.

Unfortunately I came up with a problem managing images in my database. As I've figured out, and read amongst various threads here, embedding images in a database with Access isn't a good thing (Especially if the database needs to hold 1000+ photos).

I searched the forums and found that many users asked already for this but due to my knowdledge with scripting (and the fact of being still a new user with Access2007) I can't figure out a way to implement un-embed images in my database.

My database is almost finished, I need to polish the masks a bit as well as a few other stuff but I still have to deal with this problem with images.

I wanted to ask if anyone here was kind enough to provide me some help by converting my "embed image fields" into unembed ones.

I'll explain here how the database manages images:

Table Acquisto keeps records of the object I sell and has an Attachment field called "Immagine". This field stores the embed image files.

The mask called "mask_aggiungi" add new records to the Table Acquisto and has a dedicated box for the Immagine attachment field. After adding the attachment file, it displays the picture uploaded in the database.

The following masks and reports read and edit the Immagine attachment field:


Basically the work that has to be done is to delete the Immagine attachment field and replace it with a normal text field (that could still be named Immagine) that will include the Image URL of each record. A script (and here's where I am absolutely out of knowdledge and need help) reads this new Immagine text field and displays in the Immagine boxes a "preview" of the image URL I've given to each record.

Also one last thing. In order to implement this it would be good for me to create a folder which would store my image files and that would always be the same (and never change it's path). Is it possible to only insert the Image name (and extension) given the fact that the path (and folder) would never change?


Immagine field:
filename.jpg (the database already knows the folders where to look after the file by default ex. c:documentsimages)

instead of

Immagine field:

Anyone could help me do this? I'm attaching to this post the database I've created.

Thanks a lot in advance,

Best Regards


I am a total novice with MS Access (2007) coding and I am struggling with trying to come up with a way to enable an insurance adjuster to add multiple images to any record and to generate a report that includes however many images that are associated with a given record. Can anybody help me out with this by offering strategies, examples, or informational references?

Because there may 60+ pictures associated with a single claim record my design will need to involve links to pictures residing outside the database in a folder. Each computer on the network must be able to be directed to the link addresses properly. Also, the reports will need to have a caption under each picture.

I am having trouble with exporting images in reports inMicrosoft Access 2010. I am using MicrosoftSarepoint to link with access. End usersenter data in a SharePoint list which creates a table. Sharepoint can only import images through a “Attachments”field. End users routinely attach 3 or 4photos to an individual record.
I use Access 2010 to import the data from the SharePointlist, which appears as a simple table in Access. All images appear in an attachments field. Web databases in access are only allowed 1 attachments field that can contain multiple attachments (various photos in my case).
I want to create a report that can display images in the attachmentfield. Currently, Access in only pullingthe first image in the “attachments” field. When I add the attachment field multiple times in the same report record,it pulls the same photo. I need to knowhow to tell the attachment field to display different images in the report.
Can anyone help with this?

Can anyone point me in the right direction?

I am trying to link images to a report that are different for each record.
I have tried making the data field type "OLE object" and linking the image to the report, but I have reached a 1 Gigabyte size of database and no more data can be added.

I can list the paths to the images O.K. in the data field but am having difficulty in viewing the images in the report. I keep seeing the same image.

I have followed microsoft's help files but I can only see the same image in every record not different images.

Any ideas?


Hi folks,

I'm attempting to output a report into 'rtf' format which has two embedded images in the header,

When I output the report both images have been stripped from the report, the same happens if I try to output it as 'htm' format,

Please help as to why it would do this,

My gut instinct is security or an option somewhere but I haven't found it yet,

Many thanks all

I'm learning fairly steadily with access (thanks in no small part to this forum!). I have made my own database for work use which works fine relating images to specific records - linked of course to keep the DB size down (one image per report).

The problem I'm encountering now is another database; the main DB of my company in fact. It still relates to images/reports though.
The DB is built so that users can embed images into a form which then show on a report. Regular 'spring cleaning' removes images which are no longer required, which is followed by compact and repair, which keeps the DB size down.
The problem I have is that I have a particular part of my work which requires many, many, many images as part of the same report. I've tried embedding the images once, only to find the DB seems to max out at 2GB and fails to display more than 75% of the images.

I am playing with a backup copy of this DB in order to change the image on the form from embedded to linked - this has worked okay and obviously reduces DB bloat.

However, when trying to print preview/print the report, the DB slowdown is unbelievable - so much so i'm considering going back to embedding/doing regular compact repair and having to do this particular report in stages. (I'm beginning to understand why it was built this way in the first place now!!)
When previewing the report, a message box is displayed showing info for each pic - this only reaches about 40% of the total number of images before an error message appears (no details, sorry!).

Is this just due to physical/virtual memory on the chosen PC? Or can some nice person on this forum give any help with Access? (2003 BTW).

Sorry for the length of the above - I needed to explain it properly so I could understand it


Hi there

How can I show images (one image to one record) in my report??

This images is placeret in my database as text object, and I use VB-code simular to the one in "Northwind exemple database" to show them in my formular.
I dont´t want to use the images as a Ole-object, becouse it will increase the size of my database, and data access page don´t support ole-object.

So...how do I get my pictures in to my report??

Venlig hilsen


I have some images that are stored as file paths in my database (different for each record).

I want to let them appear on my report, and this works (with an image control and some vb code), but with some problems.

1) The image looks terrible, I think this is some kind of conversion to bmp (from jpg), but I'm not sure. And as i use vb and file paths with an image control, I don't see why the image should be converted.

2) Also, everywhere I search for a solution to show images in a report, it's always only on print view. Is there a way to display them on normal report view?

Thanks seba

I’m struggling with what should be a simple problem. Each record in my database includes a field containing a hyperlink to an associated image file. The hyperlink is a relative address since the whole system is used from time to time on different computers.
Displaying these images in Forms and Reports requires that the image control contain the absolute path. Therefore I can’t set the image control directly to the link field in the record. I’ve got round this for Forms by using an Event Procedure on the After Update event that calls a decoding routine that, amongst other things, uses VBA to find the full path to the current folder, as well as performing some other checks.
Reports are a different matter, there being no equivalent at the record level to After_update and similar events. One helpful suggestion on the web is to add the path to the database files in the underlying query. That will work well for one computer but I don’t know any dynamic way to load the current path into a query.
Is it possible to do this? Alternatively could someone suggest a workaround?
I’m using Office 2010 under Win 7.

i have created a form bringing together 3 queries. one of the queries contains images the other 2 queries are text/data information.
i am now creating a report to print out the queries. each query is made into a report and then combined with a main report [2 of the queries are subreports]. the code i have used to link the images so that i get a unique image with every record is

me.[cempic2].picture = me![combined_mage_path]

however when i print the report if the record contains more then 1 image i get the following [screenshot 2].
what i need to do is to limit the image print out for each record to the first image only. the only common naming criteria for all my images is 001.jpg, 002. jpg and so on
what i need to do is to show only the image for each record that ends with the criteria *001.jpg. how would i do this in VB?

Hello Everyone,

I am hoping this doesn't require dismantling the report I've generated. Here is my situation. I have a report for which I wrote a subroutine that filters the record source. To avoid having to retype the SQL statement selecting the fields I had built into the initial report, I simply copied and pasted the SQL statement that was the original record source (minus the WHERE clause that my code adds to filter the records). However, I apparently hit an extra key that changed the statement. Now, whenever I am in Design View and I try to edit the record source I get the following error message:

"Missing ), ], or Item in query expression 'GandHtracker.[SMART ID] = PartInfo.[SMART I'."

Now I can clearly see what it is that needs to change and I know exactly what it should say. The problem is that after I click "Okay" I do not get the query in either the QBE or SQL format. The above issue doesn't seem to be causing any problems at present since my filtering code replaces the record source SQL statement with one that is correct, but I'd like to clean it up just the same. Anyone know a sneaky way to get at the SQL code?


I have an image in a report which is there on screen but doesnt print on my inkjet. Have tried bmp, jpg, linked and embedded, nothing works.
It prints on my laserjet, however. Even so, Im sure it's not the printer settings as I print images all the time.

any ideas gratefully received!

Hi! Let me describe my situation first, just to give you guys a clear view of what I'm doing. My database has links to upto 6 image files(each taking up the whole page, 8.5 by 11), per record. I'm trying to provide an interface for my users to view the image files, so I made a report, which contains 6 image files which will refresh to the images in the table (the link to the image files are passed on load). The problem isn't how to get the image file links in. It's just that it seems that there's a 23 in limit to the length of the access report. Is there any way to bypass that? Or do you suggest an alternative way to getting those upto 6 images into a report? Thank you!!

I have a report that is a customer quotation, which is based on a query. In the query, once of the fields pulled is fldSIGNATURE, which is a link to the path of an image on my network of the quote originator's signature. I would like to be able to print out the report based on this image. I have a table that has the paths to the files. Is there a way to update the image in an image frame when the report changes from record to record?

Any suggestions? I appreciate any help or direction of where to find out how to do this.



i have a series of thumbnail bitmap images that are pretty damn good quality when viewed in paint or any other program but as soon as i put them into a report their quality is awful to the point i cannot hand this to a customer like it is. the image size is not changing, its just awful looking, like its changed from 32 bit to 8 bit or something or less. When i use the same images in a form it is perfect, no problems.
What is the problem with reports? how can i fix it??


I am new to Access 2007 and I have a number of reports with three images in the header (2 logos and a banner). However, this has bloated by database in a huge way.

I've been reading and searching and it seems the solutions is to "link" the images versus embed them. But, for the life of me, (and I'm sure this is such a simple solution) I cannot figure out how to link the images in the reports.

It is the same three images used as the header for every report.

Please help and apologies if this has already been addressed. I did do a search and could not find my solution.

Thank you!

I searched through the posts looking for a way to change a form or report's record source using a macro. I found several discussion on how to do this with VBA code (see below) but none using a macro to do this.

Basically I want to be able to click on various buttons on a form, with each button opening the same form but with differenent recordsource. I do not want to do this with VBA unless it is the only way to do this.

Is it possible to do this with a macro? I am using Access 2007.

Thanks in advance,



Hello everyone,
I have a few questions about using/writing SQL.

I would like to start programming in SQL. I am a Database Manager and I have a lot of reports that are in Text Files (these Text Files contain a lot of Necessary and UnNecessary data. I want to try and use SQL to format them and extract the needed data to create a professional report.

Can I use SQL to do this?

I know this might seem like a stupid question, but I have installed and configured MySQL Ver 4.1.7 and the MySQL Query Browser on my Windows XP machine. Windows (itself) basically done all of the installing and configuring...I just answered a few questions.

Now that it is installed and everything...how do you open it up to start programming / typing the MySQL code to import the text file and format it, etc?

I have not found a ExE file to click on and open. I have attached a screen capture of what the MySQL Query Browser is asking for. I just do not know what to enter into those fields.

Can someone tell me what I need to do next....PLEASE BE DETAILED...I want to make sure that I get it right the first time.

I have read a lot of posts that talk about creating code and connecting to the server...so now I have a few questions.

If I create a set of SQL code to import, format, and create a report of my data...can I do this (run this code) independently of any other server (outside of my own computer)?

In other words...Can I take this SQL code and make it an actual program/database that has, for example, an EXE/BAT/COM extension to run on any computer (independently)?

Could everybody please provide some input on this post. It will help other Newbies in the future.


Bobby Howerton


I want to store images in a text field and show them with vba on reports and on the forms (image control).
This all works, but I need to type the path to the images.

Is there a way to use a file picker for this, but still store it in a text field?


Hi all,

i have created a access program for this WK 2010. with soccer stats and stuff like that.
(my fists access project so i have about null experience)

i want to have images in forms / reports so i went looking on Google
and found this:
there is also a 2000 version and i tried that also

oke here is my problem:

when i follow the steps on Microsoft page. the part of having a image in a form succeeds. but when follow the part for the reports. i fail! over and over again.

im not quit sure if i am doing something wrong. or that the MS page is giving me wrong information. maybe some of you can help me!

any effort is appreciated

i have created a zip with one of the million times i have tried this and uploaded it so if you need it to debug here you go

or maybe you can follow the Microsoft page and try if you could get the reports part working. and let me know.

i am working on a Windows XP system with access 2003 and latest updates.

the current database is has filesystem for 2000 but i also converted one to 2003 filesystem and tried the whole thing again. it made no difference

with kind regards

PS: im dutch so dont blame me for misspelled words.
blame my spelling checker :P

Hi there,

I have an application where users can indicate a url to their logo stored online.
When they open a report (invoice, quote) that logo gets displayed in an image frame (online image gets stored in a temp folder before that).

Now I would like the image frame to adapt to the actual image size which, of course, always varies from user to user.
I tried the fResizeImageFrame function from this post...
...but it doesn't work. Images do not get properly displayed (e.g. as I see them when I open the image in an image viewer).
This is the code in the report:

	     Me.Bild129.Picture = di
     Call fResizeImageFrame(Me.Bild129)

Has someone successfully implemented this? BTW: I am working with Access2007. But I suppose that the function etc. should work as well with the 07 version.
Thanks for help! Frank

How can I get .tif images to appear in reports. I have loaded the appropriate graphics filter for TIFF files, but still can't get .tif files in my database to appear in the report. Please help!

Hello, I have a query that has a number of fields one of which is checking to see if one value is in a list. To do this I created the following function in vba..

	Function tot(a As Variant) As Long
    If a = "1" Or a = "2" Or a = "2A" Or a = "2B" Or a = "2C" Or a = "3" Or a = "4" Or a = "4+" Or a = "5" Or a = "6" Or a =
"7" Or a = "D" Or a = "8" Or a = "E" Or a = "A" Or a = "B" Or a = "N" Or a = "W" Or a = "D" Or a = "T" Then tot = 1
End Function

and then in the query I simply use EnTot: tot([English Level])

I get the correct answer, the problem is this is unbelievably slow, so after help on this very forum I tried using SQL and thus in query designer I used:

	EnTot: Sum(IIf([English Level] In ("1","2","3","4","5","6","7","8","E","A","B","N","W","D","T","Q"),1,0))

This works miles faster and is perfect, however... Because there are a number of queries, databases and users that need to use this 'Tot' function/procedure it is impractical to have to change every query if I need to include "X" for example (as I would have to do if using the SQL version).

Is it possible to have a function in vba that somehow uses SQL to run as fast as the SQL version but obviously having the advantage of being a function that all the queries can use, instead of recreating it in every query. Does this make sense?

Any help is much appreciated.

Hi guys,

I know this is pretty basic stuff but I MS Access is not my strong point.

I am looking to simply rename a table in MS Access 2003 using SQL, can anyone please help ?

There are no reports or queries attached to it.

Am I right in saying RENAME is not a reserved word in MS Access ?


Not finding an answer? Try a Google search.