Handle Empty Recordset? - Acc2K

  • Thread starter Thread starter Tony
  • Start date Start date
T

Tony

Hi All,

I've got a database to which I need to make modifications based on client
changes. One of the functions of the database is to do some math on values
and deliver the results in a report. The reported values are hours
multiplied by $/hour. The requested changes will, from time to time,
produce an empty recordset for this calculation, i.e., there are no hours of
a specific type to be reported for a particular week.

Does anyone know if I can handle the empty recordset, either in the query or
in the report, in such a way that the report will not crash when the empty
recordset is encountered. Or, am I stuck?

Any help is appreciated.

Thanks & Ciao,

Tony
 
Any arguments in the function must be variants, and the function must return
a variant.

At the top of the function, use IsError() to test the arguments, and if so,
return Null from the function.

(I am assuming here that the problem occurs when the report has no data,
rather than when a recordset opened inside the function has no records.)
 
Hi Allen,

Thanks for the quick reply. I hacked this by adding a 'base record' that
has a value of zero and it works, but I think I'll follow your advice as it
seems to be much cleaner.

Thanks,

Tony
 
Back
Top