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

How do I not display Null/Zero fields on a report 1

Status
Not open for further replies.

raymondo

Technical User
May 3, 2002
86
AU
I have a report based on a query. Five of the fields may null or zero. For 3 of these fields, if the value is null or zero I don't want anything displayed on the report (field or label) - as if those fields did not exist as it were.
Is there a straight forward way of doing this?
Thanks. Raymondo
raymondo@rossar.net
 
Try the following at the Report_Open level. It obviously won't move things around to cover up the holes!

If IsNull([Field])or [Field]=0 Then
[Field].Visible = False
Else
[Field].Visible = False
End If

 
Thanks DrSimon,
As a first step, it's a goodun'. I suppose I could use something similar to shift all the other up - accessing their position properties or something.
I'll give it a go. Raymondo
raymondo@rossar.net
 
I wouldn't bother if I were you. Just put them on the RHS of the report and if they 'disappear' it won't look odd.
 
I have a similar problem..I have a report that is based on a crosstab query and have managed to get 0's to display if there isn't a value using the format property. However, when it displays on the report it does not act like a 0. A value is multiplied by the 0 and the result displays an error. I used the @;/0 in the format field. I would appreciate any assistance on this issue.
 
Rookiedev
What I normally do in those circumstances is to create another field whose control source is an 'Iif' statement checking for the problem/error, with a message replacing the problem result if true and the original field value if false. If that works, remove the original field or make it invisible. The problem may well come in writing a suitable Iif statement to identify the error.

Conversion of the data item to a different data type can also sometimes help - reformatting often just hides the real problem.

Simon Rouse
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top