event procedure in reports

J

Julesboca

When I run a report that contains numbers such as "Number of Items shipped"
If there is no data I get Error in place of the data. I know that this can be
corrected with an Event Procedure message, but I forgot how.
 
D

Duane Hookom

Why would you not provide us with the control source for this text box? You
might be able to use a control source like:
=IIf([HasData], Count(*),0)
 
J

Julesboca

Thanks for your help sorry I was not clear. Here is how I solved the problem:
I entered the following in the event procedure NoData
Option Compare Database

Private Sub Report_NoData(Cancel As Integer)
MsgBox "There are no records to report for the Rep or the dates you
entered", vbExclamation, "No Records"
Cancel = True

End Sub

--
Chef jules


Duane Hookom said:
Why would you not provide us with the control source for this text box? You
might be able to use a control source like:
=IIf([HasData], Count(*),0)

--
Duane Hookom
MS Access MVP
--

Julesboca said:
When I run a report that contains numbers such as "Number of Items
shipped"
If there is no data I get Error in place of the data. I know that this can
be
corrected with an Event Procedure message, but I forgot how.
 
Top