setting the record source of a report in the Report_Open function

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 :)
 
M

[MVP] S.Clark

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.
 
Top