setting the record source of a report in the Report_Open function

  • Thread starter Thread starter eddiec
  • Start date Start date
E

eddiec

hello all,

I am trying to set the record source of a report programaitcally as per KB:

http://support.microsoft.com/default.aspx?kbid=281998&product=acc2002

Subtitle: Sharing the ADO Connection Used by Microsoft Access

Normally when I do this it works OK, today I am getting an error that the
report recordset is empty.

The actual error seems to be a custom error that someone else here as
specified in the standard report template but anyway it is launched through
the: Private Sub Report_NoData(Cancel As Integer) function.

This is really odd as all I have done is copied another report that works
fine and changed the SQL string in the Report_Open function. There are
actually 7 records in the recordset that I am using for the report record
source, I have verified this using the watch window.

HELP!!!

TIA

eddiec :-)
 
My guess would be that when you did this:
"... and changed the SQL string in the Report_Open function" that you made
it such that no records were returned by the query, thus the OnNoData fired.

Remove the criteria from the where clause and see if the report runs. Add
the criteria back into the SQL string, one at a time, to figure out where
you went FUBAR.
 

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

Back
Top