Inserting Company Logo on a Report

J

JimP

I would like to insert a company logo on a report. This is a multi-user app
such that the inclusion (or exclusion) of a logo and its path/file location
will not be known until runtime (can be passed from an open form). How can I
do this?
 
J

JimP

Thank you - is it possible to create the image when the report is opened
such that an error would not be generated if someone does not want a logo to
appear?
 
S

Steve

The way to show a logo on forms and reports is to put the logo in a subform
or subreport and then add the subform or subreport to a form or report as an
unbound control. Putting an image control on every form or report where you
want a logo will very quickly bloat your database.

To achieve your goal, you can add a checkbox labeled "Show Logo" somewhere
in your report and then put the following code in the AfterUpdate event of
the checkbox:
Me!NameOfLogoSubreportControl.Visible = Me!NameOfCheckBox

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
(e-mail address removed)
 
T

Tony Toews [MVP]

JimP said:
Thank you - is it possible to create the image when the report is opened
such that an error would not be generated if someone does not want a logo to
appear?

With a bit of code in behind the report you can handle this quite
gracefully.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
T

Tony Toews [MVP]

Steve said:
The way to show a logo on forms and reports is to put the logo in a subform
or subreport and then add the subform or subreport to a form or report as an
unbound control. Putting an image control on every form or report where you
want a logo will very quickly bloat your database.

That's correct. However loading the graphic from the server is even
more efficient and saves unnecessarily bloating the FE MDB in the
first place. Also note that the original poster asked for a solution
that included loading the graphic at runtime.

Tony


--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
T

Tony Toews [MVP]

JimP said:
I would like to insert a company logo on a report. This is a multi-user app
such that the inclusion (or exclusion) of a logo and its path/file location
will not be known until runtime (can be passed from an open form). How can I
do this?

Here's the sample code for behind the reports Open Event.

' CorporateLogo is the name of the image control on the sub report
header.
Call CorpLogoOnReports(Me!CorporateLogo)

The following routine does the work. I used a hidden form called
Global Options which stores all these values. Watch for lots of word
wrap.

Sub CorpLogoOnReports(ctlCorpLogo As Control)

Dim PreviousPathandFileName As String

On Error GoTo tagError

If Not IsNull(Forms![Global Options]!jiClientLogoPathandFilename)
Or _
Len(Forms![Global Options]!jiClientLogoPathandFilename) <>
0 Then
ctlCorpLogo.Picture = Forms![Global
Options]!jiClientLogoPathandFilename
ElseIf Not IsNull(Forms![Global
Options]!poCorporateLogoPathandFilename) Or _
Len(Forms![Global Options]!poCorporateLogoPathandFilename)
<> 0 Then
ctlCorpLogo.Picture = Forms![Global
Options]!poCorporateLogoPathandFilename
End If
DoEvents
Exit Sub

tagError:
If Err.Number = 2220 Then 'Ignore file not found message
Else
MsgBox Err.Description
End If
Exit Sub


End Sub

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
T

Tony Toews [MVP]

JimP said:
I would like to insert a company logo on a report. This is a multi-user app
such that the inclusion (or exclusion) of a logo and its path/file location
will not be known until runtime (can be passed from an open form). How can I
do this?

Also for various tips including how to suppress the "Loading Image
dialog" see the Image Handling Tips page at my website.
http:\\www.granite.ab.ca\access\imagehandling.htm

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top