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

CR record display count or information passed back to VB

Status
Not open for further replies.

DeafBug

Programmer
Jul 31, 2003
47
US
I am using VB6 with CR7.

There is a report that does some filtering with formulas. The problem is that the recordset.count is always a number, let say, 1000. If it were zero, then VB will display a message box that there are no records to display.

But there is records and they all get filtered based on the formula. So it ends up that there is no records to display. The user sees a blank page instead. If I preview it, on the top-right of the Preview window it shows 0 of 1000. How do we trap that zero number? Or how do we get CR to let VB know the count of records being displayed so that if it is zero, I could kill the Preview window and display a message that there are no records to show.

The other option is to display a text on the report that there are no records to display as none of them met the criteria.

The formula is on the group header 1. We called it @GroupCriteria.

We have tried to modify the query for the recordset so that the criteria is in the query and not in CR but it doesn't work as the query can't handle user-defined arrays and stuff. We will continue to work on the query if CR has no such solution.

I hope I am making any sense as it is hard to type it.
 
Use a suppress formula on all sections such as:

IsNull({Table.Field})

where that field would not be null

Now add ni another section at the beginning or end of the report which uses the opposite and have a text box in there with "No Records found"

You migh even demonstrate the selection criteria used.

-k
 
It doesn't quite work as some of the fields on the table can be null so I don't really have anything to test against.

But a consultant told me that with the latest CR version 9, there is a event that the automation server will fire if there is no records to display. The name of the event is NoDataFired.

Is that what I need? If so, I can submit to request to get the latest version.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top