Error 3021 "No current record" on opening report

R

Rob Parker

I have an application in which I have re-designed the query which is the
record source of a report. The query has exactly the same fields as before,
and it returns about 10 records from the existing data. However, the report
will no longer open; instead I get error 3021 "No current record". This
happens both from the command button on a form (there is no Where parameter
in the DoCmd.OpenReport statement), and when attempting to open the report
directly from the database window.

Any suggestions as to what the problem could be? I've done a search of the
groups, but found nothing useful. I've also compacted/repaired the .mdb
file (the front-end of a split application). And I don't have "Name
Autocorrupt" turned on ;-)

TIA,

Rob
 
A

Allen Browne

The report is probably based on a query.
If you open the query itself, does it give this error?

If so, you may have struck a JET bug such as this one:
Outer join queries fail on Yes/No fields
at:
http://allenbrowne.com/bug-14.html

Alternatively, does the query call any VBA functions? Could this be
generating the error?

If the query runs fine, is there any code in the events of the report?
 
R

Rob Parker

Hi Allen,

Thanks for the response. I can't check everything you mentioned at the
moment, since the application in question is at my work site, and I don't
have a current copy on my home system.

Further comments in-line below:


Allen Browne said:
The report is probably based on a query.
If you open the query itself, does it give this error?

As I said in my original post, the report's record source is a query, which
I have rejigged; it contains exactly the same fields as the original query,
and it produces a set of about 10 records from the current data.
If so, you may have struck a JET bug such as this one:
Outer join queries fail on Yes/No fields
at:
http://allenbrowne.com/bug-14.html

I've just had a quick browse of your bug page, and perhaps that may be my
problem. I redesigned the query to cope with a user requirement to track a
status field (Completed) on an entity (CSI) which has its own table, but
which will appear in other tables (inspection tables, where CSI items may be
checked as being completed). My table re-design, which led to the query
re-design, now contains the Completed (Yes/No) field in the CSI_Inspections
table, rather than the CSI table. My new query does contain outer joins to
a Yes/No field which may be null. I'll try your work-around (or a variant
thereof) tomorrow at work.

BUT, if that was the problem, I would expect the query itself to fail - and
it doesn't. It's the report based on the query which gives the error.
Alternatively, does the query call any VBA functions? Could this be
generating the error?

No; that's definitely not the problem
If the query runs fine, is there any code in the events of the report?

As I said, the query runs fine, producing a recordset of about 10 records.
The report itself contains only some bog-standard code for maximize/minimize
(in activate/deactivate events), and NoData error message.

I suspect the answer lies in the outer join bug. I'll post again after I
test tomorrow. Thanks for the suggestions.

Rob
 
R

Rob Parker

Final follow-up. Problem not solved, but it has gone away. However, more
changes to user requirements meant yet another re-design of a set of
queries, and redesign of the report. The new queries (several, to build the
final one for the report's recordsource) and report do not have any
problems.

Rob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top