473,397 Members | 1,950 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Docmd.OpenReport with the use of an external query

Dear reader,

The syntax for Docmd.OpenReport is:

OpenReport(ReportName, View, FilterName, WhereCondition, WindowMode,
OpenArgs)

Example

The following example prints Sales Report while using the existing query
Report Filter.

DoCmd.OpenReport "Sales Report", acViewNormal, "Report Filter"

Report Filter" is an existing query with record for the report but still the
report is empty.

What is wrong?

Thanks for any help

Kind regards,

Simon
Mar 3 '07 #1
4 9432
On Mar 3, 3:35 pm, "Simon" <SvanBee...@Versatel.nlwrote:
Dear reader,

The syntax for Docmd.OpenReport is:

OpenReport(ReportName, View, FilterName, WhereCondition, WindowMode,
OpenArgs)

Example

The following example prints Sales Report while using the existing query
Report Filter.

DoCmd.OpenReport "Sales Report", acViewNormal, "Report Filter"

Report Filter" is an existing query with record for the report but still the
report is empty.

What is wrong?

Thanks for any help

Kind regards,

Simon

What you've posted is straight out of the help files. Do you seriously
have a working query (returns records) called "Report Filter", a
report named "Sales Report"? Beyond that there are a number of things
that could be wrong. Are there controls on the report? Do they
reference the correct fields in the query? Are you expecting it to
open on screen or just automatically printed?

Mar 3 '07 #2
If the query is in the property record source of the report it works
perfect.
And I am looking for a solution that I can use one report layout with
different queries as record source

"storrboy" <st******@sympatico.caschreef in bericht
news:11*********************@z35g2000cwz.googlegro ups.com...
On Mar 3, 3:35 pm, "Simon" <SvanBee...@Versatel.nlwrote:
Dear reader,

The syntax for Docmd.OpenReport is:

OpenReport(ReportName, View, FilterName, WhereCondition, WindowMode,
OpenArgs)

Example

The following example prints Sales Report while using the existing query
Report Filter.

DoCmd.OpenReport "Sales Report", acViewNormal, "Report Filter"

Report Filter" is an existing query with record for the report but still
the
report is empty.

What is wrong?

Thanks for any help

Kind regards,

Simon


What you've posted is straight out of the help files. Do you seriously
have a working query (returns records) called "Report Filter", a
report named "Sales Report"? Beyond that there are a number of things
that could be wrong. Are there controls on the report? Do they
reference the correct fields in the query? Are you expecting it to
open on screen or just automatically printed?

Mar 4 '07 #3
I also ran into this problem once.
I guess the filter wants to *filter* your original recordsource.
So make your report's recordsource so that all the filters you use are subsets of that data.

Arno R
"Simon" <Sv********@Versatel.nlschreef in bericht news:45***********************@news.tele2.nl...
If the query is in the property record source of the report it works
perfect.
And I am looking for a solution that I can use one report layout with
different queries as record source

"storrboy" <st******@sympatico.caschreef in bericht
news:11*********************@z35g2000cwz.googlegro ups.com...
>On Mar 3, 3:35 pm, "Simon" <SvanBee...@Versatel.nlwrote:
Dear reader,

The syntax for Docmd.OpenReport is:

OpenReport(ReportName, View, FilterName, WhereCondition, WindowMode,
OpenArgs)

Example

The following example prints Sales Report while using the existing query
Report Filter.

DoCmd.OpenReport "Sales Report", acViewNormal, "Report Filter"

Report Filter" is an existing query with record for the report but still
the
report is empty.

What is wrong?

Thanks for any help

Kind regards,

Simon


What you've posted is straight out of the help files. Do you seriously
have a working query (returns records) called "Report Filter", a
report named "Sales Report"? Beyond that there are a number of things
that could be wrong. Are there controls on the report? Do they
reference the correct fields in the query? Are you expecting it to
open on screen or just automatically printed?
Mar 4 '07 #4
If you can't do a query where all the filters are a subset of the report's
record source, set the record source to a generic query then change that
query def before opening the report.

"Arno R" <ar***********@tiscali.nlwrote in message
news:45***********************@text.nova.planet.nl ...
I also ran into this problem once.
I guess the filter wants to *filter* your original recordsource.
So make your report's recordsource so that all the filters you use are
subsets of that data.

Arno R
"Simon" <Sv********@Versatel.nlschreef in bericht
news:45***********************@news.tele2.nl...
If the query is in the property record source of the report it works
perfect.
And I am looking for a solution that I can use one report layout with
different queries as record source

"storrboy" <st******@sympatico.caschreef in bericht
news:11*********************@z35g2000cwz.googlegro ups.com...
>On Mar 3, 3:35 pm, "Simon" <SvanBee...@Versatel.nlwrote:
Dear reader,

The syntax for Docmd.OpenReport is:

OpenReport(ReportName, View, FilterName, WhereCondition, WindowMode,
OpenArgs)

Example

The following example prints Sales Report while using the existing
query
Report Filter.

DoCmd.OpenReport "Sales Report", acViewNormal, "Report Filter"

Report Filter" is an existing query with record for the report but
still
the
report is empty.

What is wrong?

Thanks for any help

Kind regards,

Simon


What you've posted is straight out of the help files. Do you seriously
have a working query (returns records) called "Report Filter", a
report named "Sales Report"? Beyond that there are a number of things
that could be wrong. Are there controls on the report? Do they
reference the correct fields in the query? Are you expecting it to
open on screen or just automatically printed?


Mar 5 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Andrew | last post by:
Hi All: I am using Access2000 and I find that the command to open an Access report in preview mode is very slow: DoCmd.OpenReport rptABC, acViewPreview, "", "" The scenario is this: - The...
2
by: Jonathan Goldman | last post by:
Hi- I have a relatively simple report that I open in an Access '97 VBA procedure, using the Docmd.OpenReport "rptName", acViewNormal syntax. The problem is that doing this usually crashes...
1
by: Filips Benoit | last post by:
Dear All, DoCmd.OpenReport RPT_TEST, A_PREVIEW, QueryAsFilter doesn't work correctly in A97 but works OK in A2K. Is this a bug for A97 ? Filip
3
by: user_5701 | last post by:
Hello, I'm getting an error with a Docmd.Transferspreadsheet line of code: DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel2000, "tblTest", pathAndFilename, True The above line...
1
by: LoopyNZ | last post by:
Hi there, I've converted an Access 97 front end to Access 2000, but when I try to run a VBA DoCmd.OpenReport (e.g. DoCmd.OpenReport "rpt_programme_listing") line, Access completely crashes...
3
by: enough2Bdangerous | last post by:
access runtime error 3011 on docmd.openreport -------------------------------------------------------------------------------- Access database (file format 2002-2003) generates reports with...
4
by: robtyketto | last post by:
Greetings, I originally used a button on a from created via the button wizard (access 2007) to run my report which was based on a query. Since I wanted to add some validation I removed the...
19
by: boliches64 | last post by:
I am trying to open a report to view an invoice for a specific invoice number. I have looked on the net and todate have not been able to resolve my problem! Help please, My code is:...
4
by: gazza10001 | last post by:
Hi i hope you can help my company uses access and has modified for its needs usually what happens is you serach for the invoice by its number and then it brings all the information up such as...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.