• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 369
  • Last Modified:

access 97 report hiding fields printing

I use access 97; i have created a report; some fields are empty.

question : if a field is empty, how can i suppress the text before a field, that it will not be printed


color : blue   --> must be printed
color :        --> field is empty; do not print this line
1 Solution
Ryan ChongCommented:
Is what you like is to do is hide the 'color:' caption in report when a field is empty?

Maybe your SQL should be like this:

Select IIF(ISNULL(table.color),"","color: " & table.color) As color, field2 from table

That's include the 'color' caption as a part of a field.

Guy Hengel [angelIII / a3]Billing EngineerCommented:
why not omit these rows from the SQL:

where NOT(thatcol IS NULL)

ludoverstraeteAuthor Commented:
sorry ,  i have a table with a field called color and the filed contains colors (white, blue,...) my problem has nothing to do with colors of fields if you understand what i mean;
other example a database with fields
car ,     company,   drivername
volvo     aml        guust
bmw                  peter
mercedes  microsoft  jan

in the record bmw the company field is empty

report :
car volvo
company aml
drivername guust

car bmw
drivername peter

car mercedes
company microsoft
drivername jan

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Guy Hengel [angelIII / a3]Billing EngineerCommented:
Unless you change your query and report design completely, this will not be possible as far as I know Access.
In the OnFormat Event of the reports detail section and the following

lblColor.Visible = Cbool(Not IsNull([txtColor]))

This will format the label for EACH record in the report, turning it on or off based on whether or not the value of txtValue is Null.

If the IsNull doesn't do the job, try Cbool(Len([txtColor]) > 0)
We had a similar situation so I think this will work for you.

Assuming that your report is built off of a query:

Remove the label "Color" from your report.

In your query, create a calculated field using the following code:

ColorLabel: IIf(IsNull([Color]),"Color","")

On your report where you had your "Color" label, insert a text box for the new ColorLabel field you created in your query.

Size the "ColorLabel" field and the "Color" field to the point that it looks like a line.

Set the Can Grow and Can Shrink properties to "Yes"

This way, if there is data it will appear, and if there is not data, it will not appear.

ludoverstraeteAuthor Commented:
ncrew  had the correct answer, but is's a lot of work
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

7 new features that'll make your work life better

It’s our mission to create a product that solves the huge challenges you face at work every day. In case you missed it, here are 7 delightful things we've added recently to monday to make it even more awesome.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now