Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Reports / Printing / March 2007

Tip: Looking for answers? Try searching our database.

Images in Reports

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
kt2902 - 07 Mar 2007 06:22 GMT
I've searched through the message boards and I can't seem to an answer to my
particular question, so here goes:

I have a company logo at the top of all my reports. Rather than embed the
image I linked it to an image stored in the subfolder of the back end of the
database. The linking is originally done in the properties of the report and
then updated via VBA when the report is opened.

This is all works fine until I install the database on a different computer
and the pathname changes. Although the VBA linking works fine, I get an error
message first because it can't find the original image. The ideal situation
would be to have an empty image box on my report that is updated every time
the report is printed, but I don't know how to insert an empty image frame.

Any suggestions? Thanks in advance

Kate
bob - 07 Mar 2007 08:18 GMT
Although Access forces you to choose an image file when you insert an Image Control, once it is inserted
you can clear the "Picture" property to remove the image, leaving a blank control that you can load at
runtime (by setting the "Picture" property to the full path to the image in the relevant event-handler).


The following article contains code to get the path to the back-end database, so if you store the image
in the same folder as the back-end (or a subfolder) you can build the path dynamically and you won't have
to remember to update hard-coded paths if the database is ever moved.  See Option (3) for split databases,
and remember to replace the table name with the name of a linked table in your database:

http://tinyurl.com/y3vzzp

It's also a good idea to verify that the file exists before loading it, to avoid an error message.  For
example:

   strPath = GetDBPath & "images\logo.jpg"
   If Len(Dir(strPath)) > 0 Then
       Image0.Picture = strPath
   End If

>I've searched through the message boards and I can't seem to an answer to my
>particular question, so here goes:
[quoted text clipped - 13 lines]
>
>Kate
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.