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

Skipping Zeroes in Access Report

Status
Not open for further replies.

Bodhis3mta3

Programmer
Feb 11, 2004
7
US
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]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top