By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,190 Members | 802 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,190 IT Pros & Developers. It's quick & easy.

Docmd.OpenReport with the use of an external query

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.