I have a report that needs to determine a set of criteria for each record prior to printing the detail line.
In the OnFormat event, I test each record in the recordset. If it doesn't meet the criteria, I set the following properties.
With Me
.MoveLayout = False
.NextRecord = True
.PrintSection = False
End With
The problem I'm encountering is the report iterates through the entire recordset before it executes the Detail_Print sub. The only loop I'm using is one that traverses an array to test the current record for qualifying criteria.
When I step through the code and it reaches the End Sub line in the Detail_Format sub, for each record, instead of going to Detail_Print, it moves back to the beginning of Detail_Format. Only when it's reached the EOF marker for the recordset does it then execute Detail_Print.
I have another report that is similar, but it performs the Print_Detail sub for each record in the recordset. I've tried setting the properties for the report that isn't working to match the properties for the report that is working. I've also recreated the report from scratch.
Any suggestions would be greatly appreciated.
Randy Johnston
Best Software, Inc.
In the OnFormat event, I test each record in the recordset. If it doesn't meet the criteria, I set the following properties.
With Me
.MoveLayout = False
.NextRecord = True
.PrintSection = False
End With
The problem I'm encountering is the report iterates through the entire recordset before it executes the Detail_Print sub. The only loop I'm using is one that traverses an array to test the current record for qualifying criteria.
When I step through the code and it reaches the End Sub line in the Detail_Format sub, for each record, instead of going to Detail_Print, it moves back to the beginning of Detail_Format. Only when it's reached the EOF marker for the recordset does it then execute Detail_Print.
I have another report that is similar, but it performs the Print_Detail sub for each record in the recordset. I've tried setting the properties for the report that isn't working to match the properties for the report that is working. I've also recreated the report from scratch.
Any suggestions would be greatly appreciated.
Randy Johnston
Best Software, Inc.