Hide Blank Columns in Report (1 Viewer)

jneirinckx

Registered User.
Local time
Yesterday, 20:22
Joined
Feb 28, 2004
Messages
133
Good afternoon,

This is a continuation of my last post about hiding blank columns in my report at run time. I have been able to set the visible property to false but the can shrink does not eliminate any blank space. I have attach a pic of my report to show you what I am trying to achieve.

Thanks for any advice you can give.

Jerry
 

Attachments

  • Sample.JPG
    Sample.JPG
    56.8 KB · Views: 523

vbaInet

AWF VIP
Local time
Today, 04:22
Joined
Jan 22, 2010
Messages
26,374
Can Shrink works on a row-wise basis, not on colum-by-column basis. You've shown us a screenshot but you haven't indicated or explained which columns you're trying to hide.
 

jneirinckx

Registered User.
Local time
Yesterday, 20:22
Joined
Feb 28, 2004
Messages
133
Thank you for your quick reply.

Would like to hide any column that does not contain data ie. KO2, KO3, KO6 etc

Thanks
 

vbaInet

AWF VIP
Local time
Today, 04:22
Joined
Jan 22, 2010
Messages
26,374
Hide them and leave the space between KO1 and KO5?
 

vbaInet

AWF VIP
Local time
Today, 04:22
Joined
Jan 22, 2010
Messages
26,374
It's not as straightforward as you would think it is because the entire thing needs to be coded. Where is this coming from, a crosstab query?

Create a query that will give the Sum of each of those fields and ensure that where there's no data it returns 0 at least.
 

jneirinckx

Registered User.
Local time
Yesterday, 20:22
Joined
Feb 28, 2004
Messages
133
It is just coming from a select query which is attached to a table that the user enters the numbers and date. All calculations are done in the query ie: totals, percent etc. I can modify the calculation to return zero if that is important.

Thanks
 

vbaInet

AWF VIP
Local time
Today, 04:22
Joined
Jan 22, 2010
Messages
26,374
If that is just a table then your table is not normalised. What would you do if you have a KO17 was needed? You would go and created a new field?

Is it a query that's displaying the totals at the bottom? Upload a cut down version of your db with some sample data.
 

jneirinckx

Registered User.
Local time
Yesterday, 20:22
Joined
Feb 28, 2004
Messages
133
I will do that but have to go out for a while now so look for it tomorrow.

Thanks again
 

vbaInet

AWF VIP
Local time
Today, 04:22
Joined
Jan 22, 2010
Messages
26,374
No problem. Myself or Bob will pick it up tomorrow.
 

vbaInet

AWF VIP
Local time
Today, 04:22
Joined
Jan 22, 2010
Messages
26,374
Well, since I had a bit of time and there were no new threads I thought I should knock up a quick example. See attached and view the report rptRecords.
 

Attachments

  • HideBlankColumns.mdb
    584 KB · Views: 643

jneirinckx

Registered User.
Local time
Yesterday, 20:22
Joined
Feb 28, 2004
Messages
133
Good Morning,

That's it vbaInet but how did you do that. I studied your report but can't find any code. I have attached a Sample DB of what I am working on so if you could give me some direction on how you accomplished that, that would be great.

Thanks again
Jerry
 

Attachments

  • Sample.zip
    1.7 MB · Views: 336

vbaInet

AWF VIP
Local time
Today, 04:22
Joined
Jan 22, 2010
Messages
26,374
The code is in the Format event of the report's Header section. Have a look there and also pay close attention to the naming convention of the controls (not fields) in the subreport and those in the main report.
 

Users who are viewing this thread

Top Bottom