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 HELP WITH "NO DATA" EVENT PLEASE

Status
Not open for further replies.

NewComer

Technical User
Apr 26, 2001
35
US
I am developing a series of reports for maintenance on aircraft and if no maintenance has been performed for a particular aircraft the query will obviously return nothing. However, at the report level I need to display in one of my text fields (discrepancy), "No Discrepancies". If anyone could help, I would appreciate it very much.

This is what I currently have...

Private Sub Report_NoData(Cancel As Integer)

MsgBox "Sorry, there were no records returned.", vbOKOnly + vbInformation

Cancel = True

End Sub
 
Try this sort of thing in your query.

SELECT tbl_aircraft.aircraft_name, IIf((IsNull([tbl_aircraft]![discrepancy])),"No Discrepancies",[tbl_aircraft]![discrepancy]) AS discrepancy
FROM tbl_aircraft;
 
You can modify the join properties query design view so that a record is created (with aircraft name, etc.) even if there are no matching maintenance records. This will create a RIGHT (or LEFT) JOIN in SQL view.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top