By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,480 Members | 2,183 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,480 IT Pros & Developers. It's quick & easy.

How do I hide blank lines in a report? - MS Access

P: 2
Kind time of day to all forumchyanam.
Please help the kettle
I searched everywhere for nothing really about the topic did not find.
There is a DB in which there is a contract and it is attached additional. agreement, and payments.
The bottom line is that there are contracts that do not have an additional agreement.
When I create a report through the report wizard, then contracts that do not have an additional agreement show blank lines. (In the others, as it is, everything is right)
How to hide these empty lines from the eyes? Or do they not appear in the report?
When I write a condition to hide those zero fields, the contract line is hidden along with it.
And this line is needed in the report. The meaning of their short text and the contract and the additional agreement.
Nov 25 '17 #1

✓ answered by PhilOfWalton

You need to do several things.
On the Detail_OnFormat you need something like
Expand|Select|Wrap|Line Numbers
  1. If Agreement > "" then
  2.     Agreement.Visible = True
  3. Else
  4.     Agreement.Visible = False
  5. End if
  6.  
Then set the Agreement Properties CanShrink & CanGrow to True
Then Set the Detail Properties CanShrink & CanGrow to True

Phil

Share this Question
Share on Google+
3 Replies


PhilOfWalton
Expert 100+
P: 1,430
You need to do several things.
On the Detail_OnFormat you need something like
Expand|Select|Wrap|Line Numbers
  1. If Agreement > "" then
  2.     Agreement.Visible = True
  3. Else
  4.     Agreement.Visible = False
  5. End if
  6.  
Then set the Agreement Properties CanShrink & CanGrow to True
Then Set the Detail Properties CanShrink & CanGrow to True

Phil
Nov 25 '17 #2

P: 2
Dear Phil thanks for the response. I'm new to all that you wrote this code where do I write in Access 2016?
Nov 25 '17 #3

PhilOfWalton
Expert 100+
P: 1,430
With the report in Design View, click on the bar that says "Detail". This should open a property box so select the Event Tab. One of the lines there says "On Format". Press the 3 dots at the end and select "Code Builder".
Enter the code I gave you (Assuming the relevant field is called "Agreement"

Phil
Nov 26 '17 #4

Post your reply

Sign in to post your reply or Sign up for a free account.