By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,251 Members | 2,760 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,251 IT Pros & Developers. It's quick & easy.

Image Attachment in MS Access

P: 2
Good day to all,

Is there a way to display an attachment (image file) in a MS Access report in which the field will adjust based on the image size. and also to display this part only if there is an attachment? If I add an attachment field to my report the image will follow the size of the field and when there is no attachment it displays an empty box in the report.
3 Weeks Ago #1
Share this Question
Share on Google+
3 Replies

Expert Mod 2.5K+
P: 3,257

Welcome to Bytes!

I am not sure there is a way to do that with an attachment field. But, if you have the image(s) saved to a known location, you can use an image control and link the location of that image to that control. Resizing the control will take accessing the metadata of the file to determine height and width of the image and adjusting appropriately. There is a bit involved with this, but it is not an impossible request. We would need more information before we can provide detailed solutions.

Hope this hepps!
3 Weeks Ago #2

P: 2
hi twinnyfo,

thanks for your reply. i don't really know much about access. for my report, i just want it to be able to show the attachments. so that when i print it the attachment will also be printed.
3 Weeks Ago #3

Expert Mod 2.5K+
P: 3,257
Again, this is done most easily by saving the file to a location known by the Database, and having a field in your table that records the path and file name of that image. Then, using an image control on your report, you link the filename to that control. You may want to take a look at this article on displaying images, which provides several examples and options from other contributors.

This is not so easily done with an attachment field (if at all possible). Like many other developers, I try to avoid using Attachment fields if at all possible. A database stores "data". An attachment field is not "data"--it is a file (or series of files). Access can work with these fields, but not in a way that is altogether intuitive for the beginner (and I personally think the complexity of working with them nullifies their value). These fields can also cause quite a bit of bloat in your DB if you are not careful.
2 Weeks Ago #4

Post your reply

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