On Mon, 01 Aug 2005 03:16:11 GMT, Claudia Fong
<cd********@yahoo.co.uk> wrote:
Delete 3 reports.
Then in the Report_Open event of the remaining one, write something
like:
imgLogo.Picture = <path_to_logo>
Now how you determine which logo to print depends on the details of
your app. If it's one of 4 buttons ("print rpt 1", "print rpt 2" etc),
then it's simple. On some more recent versions of Access there is a
more elegant solution, but this works in all:
On the form that launches the reports, put a hidden textbox. Name it
txtLogoPath. Then in the buttons' click events write:
txtLogoPath.Value = "c:\test\logo1.jpg"
and for button 2:
txtLogoPath.Value = "c:\test\logo2.jpg"
etc.
Then in Report_Open you can refer to that hidden control. Assuming
your form with buttons is called frmPrintReports:
imgLogo.Picture = Forms!frmPrintReports!txtLogoPath.Value
On more recent versions of Access you can use the OpenArgs argument to
DoCmd.OpenReport to send the logo_path to the report.
A more robust implementation of Report_Open would check for the
existence of the image (using the Dir function), and perhaps show a
static 'broken link' image if not found.
-Tom.
Hi,
I have 4 reports created in Ms-access and I will use VB to print those
reports. My problem is I'm not sure if I can control wich report to
print..
Those reports are almost the same, what is different is the logo in the
report header or page header.
Because there are 4 different logo. I want the user to choose in VB
which logo to use and then VB will print the report that the user chose.
Is that possible? I'm new in using reports so any suggestions?
Cheers!
Claudi
*** Sent via Developersdex http://www.developersdex.com ***