Report_NoData Event

R

ricky

Hi

I have a report, bound to a query, which if it returns no data, then I wish
to print certain values on the report, although I cannot seem to make this
work. I have been told to use : Report_NoData event, in conjunction with
some Unbound Textboxes, although I have tried to set some text property to
populate the textbox, but it isn't available to me, as a property.

Essentially the report will bring back data for a valid parameter supplied
via a Txtbox on a form, and excuted by a command button, although when no
data is returned, I would like to print some messages on to the report.

Is this possible?

Kind Regards

Ricky
 
M

Marshall Barton

ricky said:
I have a report, bound to a query, which if it returns no data, then I wish
to print certain values on the report, although I cannot seem to make this
work. I have been told to use : Report_NoData event, in conjunction with
some Unbound Textboxes, although I have tried to set some text property to
populate the textbox, but it isn't available to me, as a property.

Essentially the report will bring back data for a valid parameter supplied
via a Txtbox on a form, and excuted by a command button, although when no
data is returned, I would like to print some messages on to the report.


Put the message in an invisible label control.

I think you can use the NoData event to make the label
visible:
Me.label.Visible = True


Alternatively you can use the section's Format event to make
it visible:

Me.label.Visible = Not Me.HasData
 
J

JoyAA

Create an invisible text box named Text0 in your report header with
controlsource that can say something like:
"There is no data that matches your specified criteria. Please review your
choices and retry."
(Visible property = no)

Then add this code:
Private Sub Report_NoData(Cancel As Integer)
Me.Text0.Visible = True
End Sub

Hope this helps...
 

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