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

Show parameter information when report is empty

Status
Not open for further replies.

CosmoKramer

Programmer
May 29, 2001
1,730
US
I have a report that is passed three parameters: start date, stop date, and dept_id. When there are no records for that particular department and date range, I would like a custom message to appear. Something like:
"There are no appointments for department: Cardiology"

I can display a hard-coded default message that doesn't contain the department name, when there is no data, such as:
"There are no appointments for the selected department"
but the user doesn't want that, they want to see the department they selected.

I tried adding a subreport that contained the department name field and I linked the id from the parameter dept_id field to the id field in that table. That only works when data is returned, not when there is no data.

Is this possible??
 
try pass one more parameter, department name, then use it in your message.

Ted
 
Unfortunately, I can't. I'm limited to those three fields that an application is passing to the report. That's why I thought since the dept_id is available as a parameter I could link that id in the subreport to the table that contains the department names, and display the name.

I can display the id parameter, so I know that it's available.....
 
--That only works when data is returned, not when there is no data.

data is in main report or subreport, if subreport, should be from dept_id where clause only?, right? if in main report, it shouldn't impact subreport.

Ted
 
That does work, but the parameter is an id field, they want to see the name assigned to this code.

In preview mode, I don't see the subreport I added. Now I just discovered that when I double-click on the subreport area, the subreport appears in its own preview window, with the correct department name. Why doesn't it show in the main report's preview window??
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top