Report and report fields

A

Amateur

I have a report to show different datafields.
Is it possible that, if one field has no data to show or if the value is 0,
the field is invisable?
If yes, please be as kind as to tell me how.
Thanks
Klaus
 
P

Pat Hartman \(MVP\)

The field shouldn't be visible if it is null. If you want to hide it if it
is zero, add code to the Format event of the detail section:

If Me.somefield = 0 OR IsNull(Me.somefield) then
Me.somefield.Visible = False
Me.somefield_lbl.Visible = False
Else
Me.somefield.Visible = True
Me.somefield_lbl.Visible = True
End If
 
A

Amateur

Dear Pat
thanks for the answer.
I added your lines in the Detail _Format_Event section and replaced your
"somefield" with myfield "vat"
"vat" is that field which I do not want to see if the value is zero.
Now I get the error message: Compile error: Method or data member not found,
I don't understand because the "vat" field is there .
Can you tell me what went wrong?
Thanks
Klaus
 
P

Pat Hartman \(MVP\)

Post your code please.

Amateur said:
Dear Pat
thanks for the answer.
I added your lines in the Detail _Format_Event section and replaced your
"somefield" with myfield "vat"
"vat" is that field which I do not want to see if the value is zero.
Now I get the error message: Compile error: Method or data member not
found,
I don't understand because the "vat" field is there .
Can you tell me what went wrong?
Thanks
Klaus
 
P

Pat Hartman \(MVP\)

When you type Me. -- is vat an entry in the list brought up by intellisense?
 
A

Amateur

sI don't know what you mean with "intellisense" but a list opened as I wanted
to type vat into your line with all field of my report.
If that is what you mean, then yes.
If not please explain a bid more detailed because I really do not know.
Thanks
Klaus
 
Top