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

Only print fields w/data, Hide others?

Status
Not open for further replies.

Smack

Technical User
Apr 20, 2001
261
US
I want to create a report like

Test Min Max
Tensile 12 14
Elongation 23 28
Drop Dart
COF .02 .023

In the example above, the customer does not require drop dart testing. How can I have the report hide the drop dart label, and move COF up so there are no gaps? The report will have a lot more data fields for testing, and we do not want all of our customers to see all of the tests we perform, plus, all the gaps of blank data would be to "busy" when reviewed.
-Smack
 
The easiest way would be to modify the query the report is based on (I hope you have query for this report.) In the the field for Min (or Max) place and Is Not Null criteria. This way the empty records will not even make it to the report and you have no need to hide them there. %-) There is no I in team. [elf]

Robert L. Johnson III, A+, Network+, MCP
robert.l.johnson.iii@citi.com
 
I have not developed this report yet. I tried this on another report, placed Is Not Null in the criteria fields where I know this particlar form had no data, when I run the report, everything shows up blank, and the field names are still there.
-Smack
 
Just tested it in a sample database I keep for checking such things. If I read you last past correctly, you placed the Is Not Null in the field in the report. Not the right place. You need to go to the QUERY that is the source of the report. In the field that you need to select here, place the Is Not NUll in the criteria. If you need some more help, and the data is not too large, you can send to the address below and I'll fix set it up for you to see.... There is no I in team. [elf]

Robert L. Johnson III, A+, Network+, MCP
robert.l.johnson.iii@citi.com
 
Sorry I was not more clear. In a test mdb, I checked a record that had data recorded in fields, and some null data in other fields. I then used the Is not null in the Query criteria for which the report is based upon. When I run the report, no data showed up at all, but the field labels on the report still show up. In the form I will create, the tests which are run will be Tensile Max, Tensile Min etc. If there is no data, I want the report to hide the label, and shift up to keep all data together.
If I am still not clear, I can send a copy of the currently used word template (Not tied to any mdb, just manual entry everytime) to illustrate my point.
Thanks for the responses,
-Smack
* Do you find it worrying that doctors call treating you their "practice"?
 
Pleas send me the Word template you have. I am not sure where to go from here.... There is no I in team. [elf]

Robert L. Johnson III, A+, Network+, MCP
robert.l.johnson.iii@citi.com
 
Smack,

When you define your Is Not Null criteria for your fields, make sure you cascade your entries in the QBE (or use Or instead of the And operator in SQL view.....
 
Make your label for each field a text box and use the following expression to show/hide the label: =iif(isnull([fieldname]),"",[fieldname]). Then set all the text box "can shrink" properties to yes and also the report detail section "can shrink" property to yes.
-Regards
 
I still can't get the label to shrink. This doesn't work: Make your label for each field a text box and use the following expression to show/hide the label: =iif(isnull([fieldname]),"",[fieldname]). Then set all the text box "can shrink" properties to yes and also the report detail section "can shrink" property to yes.

When you do that, it shows the text field.
 
Great advise Chill81! Do you know to connect a second text box to the label to react the same way?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top