View Single Post
  #2 (permalink)  
Old March 28th, 2008, 06:41 AM
mmcdonal mmcdonal is offline
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

It looks to me that what you are asking for, while inconsistent (is this an Excel spreadsheet or an Access report?) can be done with the Access report.

Create a module, and then within the module, create 35 public variables As Boolean:

Public bCheck1 As Boolean
Public bCheck2 As Boolean
... etc


Then on the form that launches the report, set the value of the boolean based on the check box state:

If Me.Check1.Value = True Then
   bCheck1 = True
Else
   bCheck1 = False
End If

If Me.Check2.Value = True Then
   bCheck2 = True
Else
   bCheck2 = False
End If
... etc

Then on the On Format event of the Report's Detail section, do this:

Me.Column1.Visible = bCheck1
Me.Column2.Visible = bCheck2
... etc

This will set the Visible property of each column to either True or False, depending on whether the checkbox was checked or not.

If you wanted to be more rigorous, you could make sure that the default value of each check box is set to false.

Did that help? Does that resolve all your issues, or do you still have the export to Excel issue?




mmcdonal

Look it up at: http://wrox.books24x7.com
Reply With Quote