PC Review


Reply
Thread Tools Rate Thread

open two different Access reports

 
 
Associates
Guest
Posts: n/a
 
      30th Mar 2010
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
 
Reply With Quote
 
 
 
 
ryguy7272
Guest
Posts: n/a
 
      30th Mar 2010
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
>
> .
>

 
Reply With Quote
 
 
 
 
Associates
Guest
Posts: n/a
 
      31st Mar 2010
Thank you all for your replies.

It works now.

Thanks

"ryguy7272" wrote:

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

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Combine two reports from two different queries Tim Microsoft Access Reports 2 26th Mar 2009 01:24 PM
I need to add two text boxes from two different reports. Shawna Microsoft Access Reports 5 22nd Feb 2008 07:41 PM
Two different accounts, two different inboxes, automatically? =?Utf-8?B?SnVsaXVz?= Microsoft Outlook Discussion 1 3rd Sep 2004 09:22 AM
How do you make two different forms have two different startup settings? MizPatty Microsoft Access Forms 1 24th Jun 2004 11:01 AM
getting two different segments on two different routers to see each other Lyn Windows XP Networking 2 28th Mar 2004 08:42 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:59 AM.