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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Show "None" if no information on subreport 1

Status
Not open for further replies.

EllieFant

MIS
May 15, 2001
513
US
Hi all,

I am to the point of adding reports to a database. I will have a report and two subreports linked by the [DrillExerciseNum]. [DrillExerciseNum] is the primary key in the DrillExerciseInfo table and the foriegn key in the tblFinding and tblObservation.

On the main report I have a sentence that says:

The following observations were found during this Exercise/Drill.
One of the subreports will be placed just below this line.

There will be times when there are no observations so I want it to say "None." (without the quotes) in the subreport.

I have tried several things and I can't seem to get this to work.

Report Name: rptDetail
Subreport Name: srptFinding
Linking Field: DrillExerciseNum

This report will be previewed by clicking on a command button.

I have an example of how to make a message box pop up if there are no records when using a form to enter criteria for another form to open with as a filter, but not sure how to incorporate the same type of idea for a subreport. Can someone direct me in a location to be able to do this.

Thanks!



Ellie
**Using Access 97 at work**
**Using Access 2000 at home**

elliefant@qwest.net
 
Ellie,

Add a label to your report, make it's caption None and place it over / under your subreport where you want it to appear. In the On Format event of the section where the subreport resides, put code like this:
Code:
If Me!SubReportName.Report.HasData Then
   Me.lblNone.Visible = False
Else
   Me.lblNone.Visible = True
End If

Hoc nomen meum verum non est.
 
Works like a charm!!

Thanks!

Ellie
**Using Access 97 at work**
**Using Access 2000 at home**

elliefant@qwest.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top