open two different Access reports

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
 
R

ryguy7272

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top