Linking an Embedded Image from a Form to all Reports and other Forms (1 Viewer)

dungstar

Registered User.
Local time
Today, 21:09
Joined
Mar 13, 2002
Messages
72
I thought this would be pretty simple, but I cannot figure out how and wasn't able find the solution here or anyway.

I have a source form. (I can resort to having a Table with OLE Object if I must, but prefer not to.) On this source form I wish to include different things such as company logo. This will determine what logo shows up in all the reports, so all the reports will have an image linking back to this embedded image on the source form.

Pseudo-code Example:
frmSource contains imgLogo
rptSample contains an image whose
control source = Forms!frmSource!imgLogo

How can I do this or achieve the same effect in a more-or-less simple way?

TIA
 

ByteMyzer

AWF VIP
Local time
Today, 13:09
Joined
May 3, 2004
Messages
1,409
Insert an image box (imgLogo) into your form (frmSource) with the Picture Property set to the absolute path of your logo (ex. C:\My Folder\MyLogo.bmp), and the Picture Type Property set to Linked. Save these changes to your form.

In your report (rptSample) insert an image box (rptImgLogo), with the Picture Type Property set to Linked, and the Picture Property set as blank, or (none). In the Visual Basic module for your report, copy and paste the following code:
Code:
Private Sub Report_Open(Cancel As Integer)
    Me.rptImgLogo.Picture = Forms("frmSource").imgLogo.Picture
End Sub
...and save the changes.

See if this method works for you.
 

dungstar

Registered User.
Local time
Today, 21:09
Joined
Mar 13, 2002
Messages
72
Thanks, ByteMyzer. My objective is to have the source image be an embedded image rather than a linked image. All reports that require the logo will link to the embedded image. The solution you provided still requires that the source image be linked. Is there a way to link to an embedded image?
 

Users who are viewing this thread

Top Bottom