Bodhis3mta3
Programmer
Since I have garnered much experience from this site through both direct help and application modification, I thought I would give a little back.
There were a few threads regarding how to skip zero value records when formatting a report. This is how I accomplished it:
Dim lngValue As Long
On Error GoTo ErrHandler
lngValue = Eval(Reports![My Report]!MyControl)
If lngValue = 0 Then
Report.MoveLayout = False
Report.NextRecord = True
Report.PrintSection = False
Else
Report.MoveLayout = True
Report.NextRecord = True
Report.PrintSection = True
End If
Exit Sub
ErrHandler:
End Sub
I just placed this code in the report detail's OnPrint event which tells it to evaluate the value of the control at the time and if it's equal to zero, don't print or advance format to the next line, just retrieve the next record, otherwise print, advance, and retrieve. I also found that advice in one of these forums. It worked beautifully for me and I hope it works as well for you.
Kudos and thanks to all!
the bodhisattva![[thumbsup2] [thumbsup2] [thumbsup2]](/data/assets/smilies/thumbsup2.gif)
There were a few threads regarding how to skip zero value records when formatting a report. This is how I accomplished it:
Dim lngValue As Long
On Error GoTo ErrHandler
lngValue = Eval(Reports![My Report]!MyControl)
If lngValue = 0 Then
Report.MoveLayout = False
Report.NextRecord = True
Report.PrintSection = False
Else
Report.MoveLayout = True
Report.NextRecord = True
Report.PrintSection = True
End If
Exit Sub
ErrHandler:
End Sub
I just placed this code in the report detail's OnPrint event which tells it to evaluate the value of the control at the time and if it's equal to zero, don't print or advance format to the next line, just retrieve the next record, otherwise print, advance, and retrieve. I also found that advice in one of these forums. It worked beautifully for me and I hope it works as well for you.
Kudos and thanks to all!
the bodhisattva
![[thumbsup2] [thumbsup2] [thumbsup2]](/data/assets/smilies/thumbsup2.gif)