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
Can't get the Excel ado connection to work with .xls version 2.1
data transfer cable vista
How to rename a RDP session printer
Error received - "Access to the path 'C:\System Volume Information' is denied." - when trying to search for a file
where parameters aspx .net page
How do you Clone a Custom List Item
I need to capture the output of the datagrid grdAttendees and record each Members Email Address.
How to get application path in VB.NET ?
Union All Query for Sub Report Order By
Using System.IO.Directory.GetFil<wbr />es in VB.NET