Case Definition:<br>
I have a class module in which it is to generate a report from several databases based on a criterion passed to the class during initialization. The criterion could be a Global Report of only sub totals or a detailed report. <br>
<br>
Problem:<br>
When I want to return the actual recordset created by the class module it gives me an "Invalid use of property" compile error message. And actually I'm using a method to return the recordset. <br>
<br>
Code:<br>
'Several code up here, initialization of class etc.<br>
'The class returns a recordset<br>
Set TDF = clsSource.SetRecordset.Clone<br>
'Error occurs during the execution of the above stmnt.<br>
...<br>
'End of calling code<br>
<br>
'Class code<br>
Public Function SetRecordset() As Recordset<br>
On error goto errSetRecordset<br>
<br>
SetRecordset = rsTDF 'Class recordset containing results<br>
Exit Function<br>
<br>
errSetRecordset:<br>
MsgBox err.Number & " " & err.Description<br>
Exit Function<br>
End Function
I have a class module in which it is to generate a report from several databases based on a criterion passed to the class during initialization. The criterion could be a Global Report of only sub totals or a detailed report. <br>
<br>
Problem:<br>
When I want to return the actual recordset created by the class module it gives me an "Invalid use of property" compile error message. And actually I'm using a method to return the recordset. <br>
<br>
Code:<br>
'Several code up here, initialization of class etc.<br>
'The class returns a recordset<br>
Set TDF = clsSource.SetRecordset.Clone<br>
'Error occurs during the execution of the above stmnt.<br>
...<br>
'End of calling code<br>
<br>
'Class code<br>
Public Function SetRecordset() As Recordset<br>
On error goto errSetRecordset<br>
<br>
SetRecordset = rsTDF 'Class recordset containing results<br>
Exit Function<br>
<br>
errSetRecordset:<br>
MsgBox err.Number & " " & err.Description<br>
Exit Function<br>
End Function