Printing only fields that have a value on report

  • Thread starter Thread starter Alcide LaVassar
  • Start date Start date
A

Alcide LaVassar

Hello,

I would like to generate a report from a table where the
report only prints those fields with a value from the
table. That is, if I have a field called "MiddleNm" and no
value exist in that field for a record I would like the
label and the value not to be shown on the report.

Additionally, this report is columnated via the wizard and
I would like the fields with values to move up to make
more room.

I am basically trying to show information with values and
trying to fit as much as I can on a page.

Any suggestions?
 
The property to do what you want is called CanShrink, and is one of the
Format properties of a Control. This will shrink the control itself if the
value is null. It will not, unfortunately, make invisible or shrink away the
label associated with the control.

Thus you will need to add code to set the label's visible property depending
on the content of the associated text box, or, perhaps you could combine the
label and the middle initial as a calculated field, e.g.,

= "Middle Initial: " + [MiddleInitialFieldName]

and set that control with CanShrink = Yes. Be sure to use the + (not a &) to
concatenate the information -- because if the field is Null, that will force
the result to also be Null.

Larry Linson
Microsoft Access MVP
 
Back
Top