Solved

access 97 report hiding fields printing

Posted on 2002-05-17
7
335 Views
Last Modified: 2012-06-21
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

example

color : blue   --> must be printed
color :        --> field is empty; do not print this line
0
Comment
Question by:ludoverstraete
7 Comments
 
LVL 50

Expert Comment

by:Ryan Chong
ID: 7015807
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.

regards
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 7015849
why not omit these rows from the SQL:

where NOT(thatcol IS NULL)

CHeers
0
 

Author Comment

by:ludoverstraete
ID: 7015874
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


0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 7015938
Unless you change your query and report design completely, this will not be possible as far as I know Access.
Sorry
0
 
LVL 5

Expert Comment

by:bob_online
ID: 7016043
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)
0
 

Accepted Solution

by:
ncrew earned 100 total points
ID: 7016248
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.

0
 

Author Comment

by:ludoverstraete
ID: 7017411
ncrew  had the correct answer, but is's a lot of work
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Dynamically Reorder List Box 4 39
Access Update Query 1 20
Exporting Access Tables as CSV 3 24
SQL Group on First occurrence 9 26
When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question