Conditional Printing of Comment Line

J

JWeaver

I have a report that I print that sometimes requires a Comment line to be
printed for the employees (i.e., a note regarding a change in pay). How do I
set this line up so that it prints only when there is something entered in
the Comment field in the record? Also, I don't want it to print at all or
leave a blank line if it is empty, just display if it needs to be.
 
A

Allen Browne

In report design view, right-click the Comments text box and choose
Properties. Set the Can Shrink property to Yes.

Now if the field is null, it will not take up any space vertically on the
report. That assumes there is nothing at all beside it that Access has to
show.

If you may want to suppress all comments, you will need a way for the user
to specify when to show comments. For example, you could have a form with an
unbound check box that the user ticks if they want the comments. Assuming
the form is named, Form1, and the checkbox is Chk2, set these properties for
the comments text box on your report:
Control Source =IIf([Forms].[Form1].[Chk2], [Comments], Null)
Name txtComments
Can Shrink Yes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top