I am trying to create a form which prints out a report based on the selection of two combo boxes.
Combo Box 1.) Q1, Q2, Q3, Q4, YTD (dates)
Combo Box 2.) RPT1, RPT2 RPT3 RPT4 (reports)
I am first unable to get the reports to show in combo box 2. I found this code online but it includes all reports where I as I only need 4 particular reports.
Private Sub Form_Open(Cancel As Integer)
Dim Dbs As Database
Dim Rpc As Container
Dim Rpt As Document
Set Dbs = CurrentDb
Set Rpc = Dbs.Containers!Reports
For Each Rpt In Rpc.Documents
ReportList.RowSource = ReportList.RowSource & Rpt.Name & ";"
Next
ReportList.Requery
Set Dbs = Nothing
Set Rpc = Nothing
Set Rpt = Nothing
End Sub
Next I am unsure how to go about setting up combo box 1. Should I create a query? How would I set that up?
Each report is linked to a functional query. (There is no date parameters on the queries). I would like the user to be able to select whichever Report (combo box 2) and specificy for what date (combo box 1)
In the past, I have created simple reports linked to queries which allow the user to enter a date range but only for that particular report.
ANY and all help is greatly appreciated.