open two different Access reports

  • Thread starter Thread starter Associates
  • Start date Start date
A

Associates

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
 
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.
 
Back
Top