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
WCF Transport Level
Single-user 404 on <a rel="nofollow" href="https://[server]/exchange/[username]" target="_blank">https://[server]/exchange/<wbr />[username]<wbr /></a> OWA access
Outlook 2007: How to build a custom button on Client Outlook ribbon to add a message to the blocked sender list, and move the message to the hidden message box
Create NACHA Formated File using Access
how to get rid of the bcmwltry.exe-application error
Sub that makes every pivot table item visible
Win7 Ultimate upgrade in stages using OEM DVD
SQL Server database move question
time formats - coming up with totals
no change-event checkbox in datagridview