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

Can a report have a variable number of columns?

Status
Not open for further replies.

DCBBB

IS-IT--Management
Aug 22, 2001
33
US
I have a very complex report which calls for a variable number of columns. For example, let's say I need supervisors down the left as rows and their subordinates acrosss the top as columns. For data I might have hours worked this week and hours worked last week and a couple of calculations. I would like a separate report for each supervisor so can envision setting up a loop (which I can figure out). BUT, since each supervisor has a different number of subordinates, how do make the number of columns automatically grow and shrink accordingly (so no blank columns show). Is this even possible? (I know this isn't the ideal structure for a report like this, but this is how my audience wants to see it!) Thanks!
D
 
In a crosstab query/report the column headers are dynamic unless you specify column headers in the query. Is this what you want to accomplish?
 
I already have the crosstab set up, null fields and all and I have a report based off of the crosstab. Now I want the report to show columns if there's data or be totally blank if there's no data. I am fooling around with the code below in the On Format property of the detail section:

If IsNull(Me.MyField) = True Then
Me.MyField.Visible = False
Me.MyField.BorderStyle = 0
Else
Me.MyField.Visible = True
Me.MyField.BorderStyle = 1
End If

This seems to be working, but I need to tweak some things (like the labels). Thanks for your help!
D
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top