open two different Access reports

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
0
Utf
3/30/2010 4:20:01 AM
access.modulesdaovba 1670 articles. 0 followers. Follow

4 Replies
707 Views

Similar Articles

[PageSpeed] 2

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/Forums.aspx/access-modules/201003/1

0
PieterLinden
3/30/2010 4:39:28 AM
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/Forums.aspx/access-modules/201003/1
> 
> .
> 
0
Utf
3/30/2010 1:51:01 PM
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/Forums.aspx/access-modules/201003/1
> > 
> > .
> > 
0
Utf
3/31/2010 12:55:01 AM
high quality Soccer jerseys NBA Jersey tracksuit and jackets, GHD 
hairstraightener supplier from www.willpa.com

Are you a Retail businessman who bother by the purchase price?  China 
Cheapest TOP wholesale website can help you

we are specialize in replica sport goods manufacturing in china, we can 
offer you all kinds of soccer jersey, NBA jersey,shoes and so on. they are 
the best brand replica goods whih are look the same as the original goods. 
excellent quality and steady supply for them. we have been marketed in Europe 
and American for 3 year. all the goods we offer are AAA quality.  our soccer 
jersey are Thailand style. If any goods you buy from my company have problem, 
we will refund or resend them again. Most of ourProducts have no minimum 
order requirements,soyou can shop retail goods at wholesale prices. if you 
can buy more than 300usd. We offer free shipping. The more you buy the more 
discount for you.

National soccer jerseys: http://www.willpa.com
Club soccer jerseys: http://www.willpa.com
NBA Jerseys: http://www.willpa.com
T-shirt and shirt: http://www.willpa.com
Tracksuit: http://www.willpa.com
Hoody & Jackets: http://www.willpa.com
UGG boots: http://www.willpa.com
Hair style: http://www.willpa.com
shopping Index: http://www.willpa.com

EMS shipping.  7days arrive, paypal accept

want more information pls contact us or check our website: www.willpa.com
0
Utf
3/31/2010 8:39:03 PM
Reply:

Similar Artilces:

WIN X Sp2 IE8.0 killed by CPXRSYSGUARD.EXE and or ? Cant get IE8 to access the web
Tonite, I Contracted 39 versions of what SuperAntiSpyware calls: ROGUE.AGENT/GEN in my Registry HKUS\S-1-5-21 (see below) etc (in 39 different file endings) and TROJAN.AGENT/GEN-FakeSpy[Broad] 3 copies 1. in HKUS\S-1-5-21-2952124706-32014773-2762605872-1007Software\Microsoft\Windows\CurrentVersion\Run(jdfecxfs- C:\Documentsand Settings\Alan\LocalSettings\ApplicationData\ubqllk\cpxrsysguard.exe and The other two in C:\ DocSettings\Alan\LocalSettings\ApplicationData where it again opened a Folder named UBQLLK and inserted 2 copies of CPXRSYSGUARD.EXE It beg...

when i open an attachment it just shows a box i cannot open
Attachment, whether docs or pictures won't open. I can preview them inside the window pane, but then have to copy to word doc to print. Should be able to open attachment and then print just from there. Please help. It's like the Microsoft Picture manager is working strangely. ...

excel to get data from an access database
I need excel to get data from an access database similar to vlookup function from an excel table. In order to have only specific records copied to your Excel file, the query needs to include selection criteria (and sort order if necessary). Otherwise, all records get copied and you then need to create lookup formulas or use filters to restrict the set of record. If you are not familiar with Access queries, have someone who is create one for you as a stored query object in the database file. You can then use the Data>Import (Get) External Data and choose the query as your record sour...

Opening a paramater form when open a report
I have a repor that takes date parameters from a seperate form.. As it is now I have to open the form put in the paramaters and then run the report which is based on a query... I would like to have the form pop up when I open the report and then close once once the report has run.. Help Please And thanks in advance bob On Wed, 15 Aug 2007 11:56:00 -0700, Bob wrote: > I have a repor that takes date parameters from a seperate form.. As it is now > I have to open the form put in the paramaters and then run the report which > is based on a query... > > I would like to ...

How do I get my MS Pub 2000 to open Pub files from Pub 2003?
i cannot get my Publisher 2000 to open files from Pub 2003....do i have to buy Pub 2003? or is there a solution that I can download? I have already disabled my antivirus and that didn't do anything.. also my files are not "read only". pls help. thx. Novice Novice <Novice@discussions.microsoft.com> was very recently heard to utter: > i cannot get my Publisher 2000 to open files from Pub 2003....do i > have to buy Pub 2003? or is there a solution that I can download? I > have already disabled my antivirus and that didn't do anything.. also > my files ...

Export from and Import to Access
We are creating an issues tracking database using Access 2003 and would like to export information to management, obtain their feedback and update the database on a periodic basis. What is the best process for doing this? Would Access 2007 make this process easier somehow? -- gsr Per srichards: >We are creating an issues tracking database using Access 2003 and would like >to export information to management, obtain their feedback and update the >database on a periodic basis. What is the best process for doing this? >Would Access 2007 make this process easier somehow? D...

Microsoft CRM Reporting Services DateTime Parameter
Hello, I've built a report for a client using Reporting Services in VIsual Studio 2005. The report is viewed in CRM 3.0. I have, among others, 2 parameters that are using DateTime format. The client would like to be able to enter parameters for not only date, but time of day as well. As of right now, the parameter control only allows them to enter a date. I have been unable to find a way to expand the selection to include the desired time of day to the parameter. Is this even supported? Thanks, CJ ...

Publisher 2000
After I open the Publisher 2000 program and attempt to open a file or create a new document, I get the message "Microsoft Publisher 2000 Version 6.0 has encoountered a problem and needs to close. WE are sorry for the inconvenience". I tried repairing the program and even reinstalling it, but that did not correct it. Suggestions? If you are trying to use Publisher on a network - don't it is not intended for a network Publisher files have to be worked on and saved to the local hard drive ONLY. -- Hi tom (tevanz@bellsouth.net), in the Microsoft� newsgroups you posted: ...

opening links in outlook
why i can not open links attached to my e-mails mike wrote: >why i can not open links attached to my e-mails > I think you did some mistake in typing so just do one thing first type the link in notepad and then direct copy and paste that in your mail. -- Stellar Information Systems Ltd. D18, Sector-33, Infocity Phase II, Gurgaon-122001 Phone : (0124) 326 6069, 432 6700 Website : http://www.stellarinfo.co.in/ What happens when you try? Do you get the error; "This operation has been cancelled due to restrictions in effect on this computer" See http://www.m...

Problem trying to open old money file
Hi, I am trying to open a four-month old money file, which was on my backup disk. It is a *.mny file, not a backup file. It was created using the same version of Money (2005) which I still use. When I start MS MONEY and try open my old data file, it tells my that it wants convert my file so it works with this version. (Not sure why as the file was created in this version of MS Money). Then when I try and carry out the conversion it gives the following error message. "Money cannot locate xxxx or cannot open it, possibly because it is a read-only file or you do not have...

Running Virus Scan Slowing down opening files
3 minutes to open files in excel and word Are you using kaspersky virusscan? It is know for it. If yes please ask you administrator to exclude scan on harddisk or network files in the settings. -- Arien ------------------------------------------------------------------------ Arien's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1892 View this thread: http://www.excelforum.com/showthread.php?threadid=390878 All Virus Scanning can be stopped: If your using Norton Follow the below if you want to open documents much faster Open Norton Click on: Norton Interne...

eConnect can't access dll's
Hi, I've installed eConnect 7.5 and Visual Studio 2005 Beta 2, I'm going through the eConnect Serialization example. I can't get the assembly reference for the eConnectMethods to work, I've added the following using Microsoft.eConnect; using Microsoft.eConnect.Serialization; Does anyone know if I am missing a dll? or is there a problem with my install? Thanks in advance. ...

Email with tiny attachments open slow
Good Day All, I am using Exchange server 200 and Outlook 2003 mail client. I have started to experience with a single machine where all of a sudden reading emails with attachments of any size, even 6k, slows greatly. Just selecting the email item in the list takes at least 30 seconds before the lower pane shows the body of the selected item. No other client has the same problem even while this machine does. The problem seems to disappear at some point and then returns. The machine was connected to a 10Mbps switch so I changed to a 100Mbps switch and Event logs reveal nothing. I have ...

Need an open house sign in sheet
Need an open house sign in sheet That's interesting, but do you have a question about Publisher? -- James Bart: "According to creationism, there were no cavemen." Homer: "Well good riddance, their drawings sucked and they all looked like hippies!" "soozeeque" <soozeeque@discussions.microsoft.com> wrote in message news:1096B15B-9766-4573-9FC2-2053BEC1F34B@microsoft.com... > Need an open house sign in sheet I would suggest keeping it simple. Use a table for the visitors' information and maybe your real estate company's logo...

Count rows that match criteria in 2 different column cell ranges
I have a spreadsheet that lists all customer orders for the year - each order is a row. I need to count the number of orders per customer per month. I'm having trouble figuring out what formula to use to count the number of rows in which the customer column (a range named "customer") = "xxx" and the month column (a range named "month") = 1 (for January). I've tried several combinations of things and keep getting errors. I've tried ROWS, COUNTIF, IF with COUNTIFs and/or ROWS, etc. to the point that I'm thoroughly confused. I'm sure th...

Converting Access 2000 to Access 2003 or XP
I have Access 2000 on my home PC and want to install it on my business PC. I also need to upgrade this program. Do I upgrade first, then bring it to work? Also, if the software is licensed to me at home, can I install it on my business computer as well? Thank you. No, each install has to have its own separate license. The Access 2000 on your home PC is only licensed for you home PC. If you are planning to upgrade, you would be better off buying the full installation of Office 2003 or Office 2002 to install on your business machine. If installing Office 2002/2003 to more than one machin...

combining folders(calendar, inbox,,outbox,contacts,etc)that appear in two places
I need assistance in configuring my Outlook, particularly since I just started to receive my email via outlook. I have folders with the same labels and names in"Outlook Today" and "Personal Folders". The calendar with information and listing of all tasks are in Personal Folders section with Outlook Today being empty. I believe my email is coming into Outlook Today area. I would like to consolidate these areas, I think under Outlook Today, and learn more re when to use what. The outlook today is synchronous on our LAN but there is nothing of import there thus defeat...

cannot open excel file from outlook
Excel 2007 cannot open document eithout first saving and opening thru excel Try to re-register Excel. Close Excel first and On the Windows Taskbar Start>Run "excel.exe /regserver"(no quotes)>OK. See the space between exe and /regserver You might have to designate a full path to excel.exe. In that case Start>Run "C:\yourpath\excel.exe" /regserver(quotes required)>OK Gord Dibben MS Excel MVP On Wed, 27 Jan 2010 11:38:12 -0800, Rick <Rick@discussions.microsoft.com> wrote: >Excel 2007 cannot open document eithout first savi...

opening links
Whenever I try to open a link in Outlook XP -- (Win XP Pro) it opens a "open with" prompt/box. Point it to the .exe for your preferred browser and click okay. --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. Due to the Swen virus, all e-mails sent to my actual account will be deleted w/out reading. After searching google.groups.com and finding no answer anonymous@discussions.microsoft.com <anonymous@discussions.microsoft.com> asked: | Whenever I try to open a link in Outlook XP -- (Win XP | Pro) it opens a "open with&quo...

unable to open your default mail folders...
I am running XP Pro and Office XP 2002. I currently use Outlook express on this PC but want to switch over to Outlook. When I try to open Outlook I get the message- Unable to open your default mail folders. Could not open item. Try again. Any ideas what's going on ??? Thanks in advance!!! -- Dennis Have you created a mail profile and installed your mail account(s)? -- Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. ALWAYS post your Outlook version. How to ask a question: http://support.microsoft.com/KB/555375 After furious head scrat...

using my Money 2005 file on two different computers
I use MS Money 2005 for my personal financle data. My Money file lives on my computer. I want to have my bookkeeper enter data into this file. I want to be able to have her work on the data from her computer which is networked to my computer. We have tried opening the file from her computer over the network with no sucess. We can see the file but the password does not work. We have tried burning the file to a CD but when we try to open the file from her computer we can get the password to work. The same thing that happens when we try to restore a backup on her computer. We tried usi...

Workbook always opens at a specific sheet and cell
I have a workbook consisting of many sheets. How do I make sure that everytime I open the work book, it would directly point to a specific sheet and cell? Hi put the following code in your workbook module (not in a standard module). sub workbook_open() me.worksheets("sheetx").activate end sub -- Regards Frank Kabel Frankfurt, Germany Zee wrote: > I have a workbook consisting of many sheets. How do I make sure that > everytime I open the work book, it would directly point to a specific > sheet and cell? methinks the original poster also wanted to activate a particu...

Purchase Request Resolution Report contains no data
Our user would like to print all the items listed in Purchase Request Resolution Grid but when we click on the Print button the report doesn't bring up any data. Any idea? Speedy, The report attached to the print button on Purchasing Request Resolution contains the "Actions" that were taken on items in the window. For example. Action Performed PO Number Vendor ID Vendor Name Vendor Item Number Item Number Item Description Quantity Ordered U of M Site ID Due Date =================================================...

report definition not valid
Good Afternoon. I have been getting this error recently. "The report definition is not valid. Details: The report definition element 'ConnectionProperties' is empty" Every time I make changes to the report and save it, an incomplete ConnectionProperties element is added back to the rdl as follows: <ConnectionProperties> <ConnectString /> <IntegratedSecurity>true</IntegratedSecurity> </ConnectionProperties> If I remove this element and run the report, it works again until I make another change to the re...

How can I access the windows clipboard?
On closing a number of applications ask if I want to keep the data on my clipboard available for other applications. How can I look at the clipboard, either before or after closing down, to see what is available to me there? The Windows clipboard will contain the last thing you copied. -- <>>< ><<> ><<> <>>< ><<> <>>< <>><<> Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org <>>< ><<> ><<> <>>< >...