Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running a report from vba

Status
Not open for further replies.

Hawkide

Technical User
Oct 8, 2003
159
US
Access 97

How do I run a report from vba? TIA..
 
docmd.openreport

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Hi. I've noticed lately you are asking a lot of questions that seem easily answerable by either searching this forum, reading on line, or looking in a text book. Maybe you can try those avenues first before posting here?

Thanks!

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
You're probably right. I'll try to do more research beofre I post, and be more selective with my questions. I am pretty new to all this Access stuff, so I am not sure sometimes if the question is findamental or not.

For example, right now I am opening a report with doCmd.OpenReport (thanks to your help). I used the filtername argument to specify the query to use. However, my report has 2 charts on it. Each chart uses a different query. I am wondering if I can somehow specify 2 queries for the filtername argument. My workaround is to run the second query and leave it open before I call doCmd.OpenReport. This seems like a hack to me.

Now, in your opinion should I post something like that? I only spent about 10 minutes thinking about it before now. The Access 97 help file for OpenReport doesn't say anything about 2 queries. My book doesn't either. Can you school me on what avenues you would use to find an answer to something like this.

Thanks for any insight you can give. I truely don't want to waste people's time (including my own), and I also don't want to deprive myself of the valuable learning experience that comes from troubleshooting something on my own. This is sometimes a difficult goal to balance...
 
I need more info: so your report has two charts embedded in it. Does the report have a recordsource? what is it? what are the recordsources for the two charts? why are you needing to run queries before opening a report? the queries run when the report is run.

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks for the info. Just as you said, the report does run without running the queries first (much faster as well). I am not quite sure why I thought I had to run the queries first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top