getting the "no data" from report

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there anyway to get the "No data" return value from a report? I have all
my code that generates a report dynamically in the report so I want to grab
the "No Data" value in a form. Only thing I can think of is in the report
"No Data" event creating a table to store the flag and have the form check
that table when the code executes. Thanks
 
If the form is open, you could assign the value to a textbox (hidden, if
desired) on the form. You could then get the value from the textbox.

Example:
Forms!frmMyForm!txtMyTextbox = "No Data"
 
That was the route that I was hoping that i wouldn't have to go. I was
thinking there was a slick way to just grab the "No Data" seemlessly rather
than having a text/label to hold it. It was worth the try tho.
 
Well, there are other options. 1) You could set the value of a global
variable since that would be available anywhere within your database. 2) You
could have the code that opens the report use DCount with the parameters
limiting the report and check first to see if there are going to be any
records in the reports recordset. If the report is using a query with no
filters defined in the report itself, you could just do a DCount on that
query.
 
Back
Top