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

hide / Minimise fields with no data 1

Status
Not open for further replies.

TimTDP

Technical User
Feb 15, 2004
373
ZA
In a report I have a added a Group to a field, and the neccessary fields to the Details section of the Group.

If one of the fields in the Details section is null, I want to hide all the fields in the details section. Ideally I would also like to reduce the hieght of these fields to reduce white space.

Who should I do this?
 
Does it work for you to cancel the printing of the detail section if the field is null? You can add code to the On Format event of the detail section like:
Code:
Cancel = IsNull(Me.txtOneOfTheFields)

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
No I do not want to cancel the printing.
The detial section will always have 2 fields. One will always have a value. It is the 2nd one that I want to manipulate if empty.
 
I thought you were serious when you stated "I want to hide all the fields in the details section".

If a field is null, it will not display. Can you be a little more specific with what you have for records and how you want them to display in a report?

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
The detail section has two fields, positioned one below the other. The first field will always have data so I need to always show it in the report. However the second field (below the first field) does not always have data. If the feild does not have data, I want to:
1. Preferable minimise the height of the field so as to reduce white space.
2. hide the field, and its label.

Assuming there are 3 records for the report, and in the 2nd record the field is null:

The current result looks like this,

Field 1 Label Field 1 record 1 data
Field 2 Label Field 2 record 1 data
Field 1 Label Field 1 record 2 data
Field 2 Label
Field 1 Label Field 1 record 3 data
Field 2 Label Field 2 record 3 data

I want the result to look like this,

Field 1 Label Field 1 record 1 data
Field 2 Label Field 2 record 1 data
Field 1 Label Field 1 record 2 data
Field 1 Label Field 1 record 3 data
Field 2 Label Field 2 record 3 data

hope this is helpa!
 
You should be able to change the Field 2 Label to a text box with a control source like:
="Field2 Caption " + [Field2]
Then set this text box and the Field2 text box to can shrink. Set the section to can shrink.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top