Solved How to Insert Logo Saved as Attachment on a Report (1 Viewer)

Pac-Man

Active member
Local time
Today, 10:45
Joined
Apr 14, 2020
Messages
416
Hello,

I need Insert Logo on all reports. Logo is saved as Attachment in a table. How can I Insert this Logo in my reports. I tried using dlookup in control source of an image field but it didn't work.

Best Regards
Abdullah
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 13:45
Joined
May 7, 2009
Messages
19,233
you need to Extract first the image from Attachment.
then assign the path of the image to the Picture property
of the Image control.

see this demo (sampleReport).
see the code on Load event.
see the function PictureFromAttachment, in Module1.
 

Attachments

  • logoOnReport.accdb
    1.3 MB · Views: 310

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 06:45
Joined
Sep 12, 2006
Messages
15,652
Can you not save the logo as an image file on your PC/server, and then use that image file (or any other) on your form/report?
 

Pac-Man

Active member
Local time
Today, 10:45
Joined
Apr 14, 2020
Messages
416
you need to Extract first the image from Attachment.
then assign the path of the image to the Picture property
of the Image control.

see this demo (sampleReport).
see the code on Load event.
see the function PictureFromAttachment, in Module1.
I'm away from PC right now. I'll check it and then let you know. Thanks for the db.
Best Regards
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 22:45
Joined
Oct 29, 2018
Messages
21,467
Hi. You have two options:

1. Instead of using an Attachment field, save your logos in the Image gallery, or
2. Use a subreport to display your logos
 

Pac-Man

Active member
Local time
Today, 10:45
Joined
Apr 14, 2020
Messages
416
Hi. You have two options:

1. Instead of using an Attachment field, save your logos in the Image gallery, or
2. Use a subreport to display your logos
Thanks for reply @theDBguy, subreport could be used... never thought that way. Thanks a lot.
By image gallery, you mean my PC image gallery or something else? My purpose is if in future I change the logo, I don't have to change on individual reports. Solution provided by @arnelgp works perfectly. I have seen his db now. But Happy to know other method suggested by you by which I could achieve the purpose.
 

Pac-Man

Active member
Local time
Today, 10:45
Joined
Apr 14, 2020
Messages
416
you need to Extract first the image from Attachment.
then assign the path of the image to the Picture property
of the Image control.

see this demo (sampleReport).
see the code on Load event.
see the function PictureFromAttachment, in Module1.
Thanks for the db @arnelgp. I have seen the report and module1. It works as I needed. Thanks a lot.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 13:45
Joined
May 7, 2009
Messages
19,233
goodluck abdullah!
Bismillahirrahmanirrahim!
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 22:45
Joined
Oct 29, 2018
Messages
21,467
Thanks for reply @theDBguy, subreport could be used... never thought that way. Thanks a lot.
By image gallery, you mean my PC image gallery or something else? My purpose is if in future I change the logo, I don't have to change on individual reports. Solution provided by @arnelgp works perfectly. I have seen his db now. But Happy to know other method suggested by you by which I could achieve the purpose.
Hi. By Image Gallery, I meant this.
1611589106032.png
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 22:45
Joined
Oct 29, 2018
Messages
21,467
OK. Thanks for image. But by this method I've to change images on all reports of the i need to replace logo.
No, you don't. When you update the Image Gallery, all objects (forms and reports) are automatically updated as well.
 

Users who are viewing this thread

Top Bottom