Skip a detail row in an access 2007 report

Cazar
Cazar used Ask the Experts™
on
I need to skip a detail row in an Access report when one of the detail values is null. I can't change the query that feeds the report to eliminate the null rows for reasons I won't go into here.

I saw this solution in another post:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    If Me.MyID = 1 Then Cancel = True
End Sub

I added this to the report code, but it does not seem to get called. I even changed to condition to if 1=1 then cancel = true, but it still did not work.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
Try using the Filter property on Report_Open

Gary
Commented:
I discovered that the potential solution I mentioned in the question was actually working. The null rows show up in the report view but do not show up when printed.

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    If Me.MyID = 1 Then Cancel = True
End Sub

Thanks

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial