Report and report fields

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 
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
 
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
 
Here comes my code:

Private Sub Detail_Format (Cancel As Integer, FormatCount As Integer)

If Me.vat = 0 OR IsNull(Me.vat) thenEnd Sub
 
Sorry, I copied a part of it.
So, in my original is of course not the >>
 
When you type Me. -- is vat an entry in the list brought up by intellisense?
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top