Microsoft
Software
Hardware
Network
Question : Why won't this work
In a couple of my routines I display a list of errors using a simple msgbox. Some users want to be able to print that so I want to use the following code to print it off.
bPrint = MsgBox(sMessage & vbNewLine & vbNewLine & "Do you want to print this message?", vbYesNo, "Print")
if bPrint then DoCmd.OpenReport "rptSysMessage", acViewPreview, , , , PrintMessage
rptSysMessage is an unbound report that contains a single unbound variable called PrintMessage and I have loaded the following code in the On Report_Load event: Me.PrintMessage = Me.OpenArgs
I have also tried moving the code into the On_Activate Event too.
Try as I will I can't seem to get the OpenArgs value to get to the report so all I get is a blank page. Can anyone tell me what I am doing wrong?
Answer : Why won't this work
Create a variable named PrintText in the report and pass the args like this:
if iPrint = vbYes then DoCmd.OpenReport "rptSysMessage", acViewPreview, , , , "PrintText="PrintMessage
Random Solutions
How to get SSL working on extended 'Internet' SharePoint site
Automate import of multiple data files, based on multiple auto-imported file layouts.
Crosstab with subquery
Strange recycling of ASP.NET worker process without hitting any pre-defined limits!
C# Replace Statement
store a query result in a table
ASP.NET Gridview with linkbutton
How to associate a default schema with a login
CertSelectCertificate hook Callback Function does not get called
Anybody have VBA code to force run Macro when open, but also will lock down access to VBA editor without password