http://www.fontstuff.com/access/acctut19.htm
Go to the bottom of the page and download the sample.
Open the DB and hit Alt+F11. Double-click on the form named
'Form_frmReportFilter1' and you will see the VBA code.
Replace this:
If SysCmd(acSysCmdGetObjectState, acReport, "rptStaff") <>
acObjStateOpen Then
MsgBox "You must open the report first."
Exit Sub
End If
With this:
If SysCmd(acSysCmdGetObjectState, acReport, "rptStaff") = acObjStateOpen
Then
DoCmd.Close acReport, "rptStaff"
End If
DoCmd.OpenReport "rptStaff", acViewPreview
Close, Save, Run.
That's an excellent example of how these things work. Post back if you have
specific questions.
--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.
"PieterLinden via AccessMonster.com" wrote:
> Associates wrote:
> >Hi,
> >
> >I was wondering if i can get some help here. I have two different reports
> >that i want to open when a user clicks a button to view the reports for
> >printing. Is there any way of popping them up at the same time in VBA?
> >
> >Thank you in advance
>
> Yes. Call the DoCmd.OpenReport command twice... once with each report name.
>
> --
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/For...dules/201003/1
>
> .
>