getting the "no data" from report

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
 
W

Wayne Morgan

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"
 
G

Guest

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

Wayne Morgan

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.
 

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

Top