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

Access report-suppress 0 records

Status
Not open for further replies.

ranebow

Programmer
Mar 8, 2003
110
US
I have a table that may have zero in one of the fields. I'd like to NOT print this record on the reports.
 
In the On Format event of your report's detail section, put code like this:
Code:
If Me.YourZeroField = 0 Then
   Cancel = True
End If
If that control = 0, then the detail line will not print.
 
I must be doing something wrong. I right click on the DETAIL header on my report and pulled up properties. Then in ON FORMAT I created the following EVENT:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Me.PurchasePrice = 0 Then
Cancel = Ture
End If
End Sub

When I run the report the records with a zero purchase price still show up.

 
Is PurchasePrice the name of the text box, and not its control source??

Is
Code:
Cancel = Ture
just a typo from putting the code here??
 
It was a typo in the event!!!! Thank you. It works fine!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top