Creating reports based on checkboxes in the form

  • Thread starter Thread starter Student
  • Start date Start date
S

Student

Guest
I have a form that has checkboxes on it. I also have a command button on the form. When the command button is selected, I want to create a report that displays all the items checked off in the checkboxes.
 
You will need to either create multiple reports and have a series of if tickbox1 and tickbox2 = true then open report x etc. (Hard way and will get messy if you need to change the report)

Else reference your query criteria to the form. ie in the query criteria put.


iif ([forms]![yourform]![yourtickbox] = true,"Find this if Ticked","Find that if not Ticked").

You can even reference controls on your report to match those on your form. Just set the control source to =[forms]![YourForm]![Yourfield]

Hope that helps.
 
This is how I have done it in the past...

Build a report that has all the fields that could possibly be included as options in the report.

In the OnOpen event of the form use code to dynamically hide/show the field.

Like

Me!OptionalField1.Visible = Forms!MyOptionChooser!Field1

Me!OptionalField2.Visible = Forms!MyOptionChooser!Field2

By setting fields and sections to CanGrow and CanShrink you can shrink the sections to fit the data.

If you want fancy formatting and your report is not columnar then you may better building mutiple reports.

You could even amalgamate the two ideas as a combination of reports and OnOpen code depending on what options are chosen to display the most appropriate report and then fiddle with visibility to tailor the request.

Ian
 

Users who are viewing this thread

Back
Top Bottom