Button that will generate multiple outputs based on combo box inputs

bstboy

Board Regular
Joined
Oct 4, 2005
Messages
84
Sorry for the long winded Subject line.

So I currently have a form which has 5 different options to select in order to generate a report. Am I able to create a button which will generate all 5 reports with one click so i don't have to pick and choose each option and print separately?

Thanks
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Yes, you can do that. Do you just need them to print? Are you always going to want all 5? Or do you want the ability to only select some at some times and all at other times?
 
Upvote 0
I would want the ability to do it, but it doesn't need to be all of the time. Not sure weather I want to export it to .pdf or directly print the report, still haven't made that decision.
 
Upvote 0
So, here's one way. You could have a table which has all of the reports listed in a text field (with their name and then a friendly name). You would have a YES/NO field in that table too.

Then you can put a subform on the form that you have and put it in Continuous view so then the user can check off the reports they want and then click the button. The code to print would be:

Code:
Dim strSQL As String
Dim rst As DAO.Recordset
 
' selects only those marked as true
strSQL = "Select * From TableNameHere WHERE YesNoFieldNameHere <> 0"
 
Set rst = CurrentDb.OpenRecordset(strSQL, dbOpenForwardOnly)
 
Do Until rst.EOF
    ' opens the report as normal which prints it right away without viewing
    DoCmd.OpenReport rst!ReportNameFieldHere, acNormal
    rst.MoveNext
Loop
rst.Close
Set rst = Nothing

Remember to replace the names of things with your own names as I've just put in generic naming in there as a flag to you as to what to change.
 
Upvote 0
Still having trouble because the combo box I have which is selecting the report is in the form header and all of the data that will show on the report is a subform in the form detail. I guess I'm having trouble visualizing what to do. I've created the continuous form but I'm stuck there.
 
Upvote 0

Forum statistics

Threads
1,224,517
Messages
6,179,240
Members
452,898
Latest member
Capolavoro009

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top