print report using form criteria

deb

Active Member
Joined
Feb 1, 2003
Messages
400
Hello All,

I am using Access2K and VBA. I have a query by form which has several list boxes. The form filters by the choices selected in the list boxes and displays the results in the sub form embedded at the bottom of the master form. The subform's row souce is fed by the list box selections on the master form using VBA.

By clicking a button, I need to be able to send this criteria via VBA to the query that runs the report and then have the report open. The report should then have only records from the form selection.

Please help, I'm goin crazy over this. :rolleyes:
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
It sounds like you've already done the work of building the modules that allow you to control the record source.

Just like you probably modified the subform Recordsource, extremely similar syntax allows you to modify a Reports' Recordsource.


Go into the VBA function(s) that you setup to feed the recordsource to the subform. Add a string variable that will hold the full SQL expression of a query representing the fields AND parameters you wish to use.

You can then pass the value to Reports!report_name.RecordSource.

Mike
 
Upvote 0
Thank you for your help.

I am learning Access so I appreciate you patience.


How do I pass the value to Reports!report_name.RecordSource?
 
Upvote 0

Forum statistics

Threads
1,221,780
Messages
6,161,888
Members
451,730
Latest member
BudgetGirl

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