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

Hide field in report detail

Status
Not open for further replies.

mtompkins

IS-IT--Management
Jan 14, 2003
166
US
Gents -

I have a report which in the detail area at times has one field with a value that is occasionally zero.

During such listings, I'd rather hide that zero value. All other times I'd like it to appear.

Any thoughts?
 
I could see you making an IIF statement:

=IIf([field]=0," ",[field])
Will make all zeros be blank

-Pete
 
Here are two possiblities:
[tt]=IIf([MyField]=0,"",[MyField])[/tt]
Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Me.[MyField] = 0 Then
    Me.[txtText].Visible = False
Else
    Me.[txtText].Visible = True
End If
End Sub
 
Thanks Snyper..

You know I tried this, but when I did I used "" instead of a space and received an error, and never stopped to think why.

Sad.
 
Hi Gents-

THe problem here is - the data is in a subreport's detail of the main report's detail field.

By using the above methods I either get a circular reference error - or it makes all listings either visible or not.
 
For IIf, have you renamed the control to anything other than the name of the field?
 
Long days, long nights ...

sorry gents - the problem is it wasn't a value of zero - it was a string of "0".

 
You bet snyperx - long hours of coding - sometimes the basics just slip me...

But thanks all.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top