Using Single Images Across Multiple Forms and Reports in Access 2010 Applications
Summary: Learn how to use the image gallery in Microsoft Access 2010 to save space and replace images across multiple forms and reports.
Applies to: Access 2010 | Access Services | Office 2010
Published: December 2010
Provided by: Ken Getz, MCW Technologies, LLC
This article describes how to use the new shared image gallery in Access 2010. The shared image gallery enables you save space in the database by sharing images across multiple forms and reports. In addition, the gallery has a simplified interface. By using this interface, you can replace an image across a project. Many database developers use shared images: logos, footers, headers, and so on. Often, a developer uses these images on each form or report in an application. Prior to Access 2010, Access created a separate instance of an image every time that you used an image. (The exception was if you manually wrote code to insert a single image at run time). In Access 2010, you can use the new image gallery, which enables you to share images across multiple forms and reports. Creating the Sample Database The first step is to create a sample Access database. You will use this database to experiment with the new image gallery. To create the sample database
Adding and Inserting an Image on a Form Once you have downloaded and installed the sample database, you can add and insert the image on a form. To insert an image using the image gallery
Reusing the Image on a Report Now that you have added an image to the gallery, you can reuse the image on any form and report. To reuse the image on a report
Exploring the Gallery Storage Access stores the images in a hidden system table name MSysResources, which you can easily locate. To view the hidden system table
Replacing the Image Each instance of an image from the gallery that you display on a form or report actually contains a reference to the shared image. Therefore, you can easily replace an image across all uses, without having to visit each form or report. To replace an image across all uses
Renaming the Image Access retrieves an image from the gallery by using the image name as a keyword. As such, each shared image instance includes the name of the original image in the properties of the image container. Therefore, if you change the name of the picture in the galley, you must also manually update the name of each instance of the image in your application. To rename the image
Access 2010 stores the image gallery in the database itself. Therefore, you do not have to have any additional software to use the gallery. Because you store only a single copy of each image, you can significantly reduce the size of the database application. In addition, you can replace the image in the gallery in order to replace all instances of the image. This change will propagate to each form or report on which the image appears. You can therefore maintain your application much more easily by using this tool. Be aware that Access includes a Logo button in the Header/Footer group of the Design tab for forms and reports. The Logo button inserts a selected image in the upper-left corner of the current form or report. For client forms and reports, Access stores the image directly on the form. For web forms and reports, Access stores the image in the gallery, and then places a reference to the image on the form or report. Important Be aware that in using the Logo button for client applications, the button places a single copy of the image that you select on each form and report. You can also use the image gallery to create a background image for a form or report. However, this feature works only for client forms and reports. |
> [!VIDEO https://www.microsoft.com/en-us/videoplayer/embed/5121ad49-4fd0-4484-9c89-531e79a3f88f] Length: 00:20:29 About the Author |