472,784 Members | 1,079 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,784 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 9379
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...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?

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.