Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to generate a report indicating "data data available..." 1

Status
Not open for further replies.

cohibaman

MIS
Aug 22, 2002
22
US
A series of queries are run(under a macro) and tables are created to generate a report. The issue that I have is in handling a blank report. A blank report(titles and headers do print)is generated when the filtering/selection criteria are not met. In order to avoid confusion with the report's receiptant, I need to indicate on that report something like: "No data is available for the reporting period". Otherwise the results of the report are then questioned.
Any suggestions would be appreciated.
 
I assume that the reports are predesigned
if so put a label in the detail section with "No data is available for the reporting period" then place the code below
If IsNull(Your Field Name) Then
LabelXX.Visible = True
Else
LabelXX.Visible = False
End If

It might work

Hope this helps
Hymn
 
Thanks for your help. However, I'm new at this. I entered the following code:

Private Sub Report_NoData(Cancel As Integer)
If IsNull Office Code Then
Label35.Visible = True
Else
Label35.Visible = False
End If
End Sub

I'm receiving a Visual Basic "complie error: syntax error". Could you please help me to debug this.
Thanks!
 
Try this syntax
If IsNull([Office Code]) Then
Label35.Visible = True
Else
Label35.Visible = False
End If
End Sub

 
Well,that resolved the "compile error", but the label did not displayed on the report. What should I check for?
Thanks
 
is the field [office code]text or numeric

Hope this helps
Hymn
 
Try
In design view go to
properties/events/On No Data
place the code
LabelXXXXX.Visible = True

Hope this helps
Hymn
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top