Query length problem

  • Thread starter Thread starter Omer
  • Start date Start date
O

Omer

Hi,
I'm trying to raise a report from within a VB code
section (using DoCmd.OpenReport). When doing so, the
report comes out empty (no records are retrieved). If the
report is generated by clicking on it (from the database
window, "Reports" section), and using the same query, the
report comes out OK.
I suspect there's a limit on the query's length when
running a report from within a VB code section. Have
anyone experienced a similar problem before ?
Kind Regards
Omer
 
No, using OpenReport from code should not make any difference.

Presumably you are using preview mode, without anything in the Filter or
WhereContition, e.g.:
DoCmd.OpenReport "MyReport", acViewPreview
and the report is not already open.


1. Does the report have any code in its module, or is its HasModule property
Yes? For example, could there be anything cancelling its Open or HasData
events, or reassigning its RecordSource?

2. If the report is based on a query, are there:
- calculated fields that are part of the WHERE clause?
- any criteria that refer to controls on a form, such as:
[Forms].[Form1].[Text1]
Calculated fields can be misinterpreted:
http://members.iinet.net.au/~allenbrowne/ser-45.html

If those ideas don't apply, then there is a good chance that Name
AutoCorrect has corrupted your database also. I think they should have
called this feature, "Name AutoCorrupt" - that's about what is is. See:
http://members.iinet.net.au/~allenbrowne/bug-03.html

If is is corrupted, try the 6 steps in the first symptom under:
Recovering from Corruption
at:
http://members.iinet.net.au/~allenbrowne/ser-47.html
 
Back
Top