I am new to this forum so I apologize if I am posting this in the wrong place.
I am using a form with 2 combo boxes for the user to enter a start date and end date. I want this to be passed to a query. The form also contains a button to run a report from that query.
My issue is I enter the dates into the combo boxes and try to run my report using the button but I am still prompted to input the start and end dates. Can someone please help?
The names for for the combo boxes are "QtrStartDate" and "QtrEndDate".
Here is the code I have so far:
I am using a form with 2 combo boxes for the user to enter a start date and end date. I want this to be passed to a query. The form also contains a button to run a report from that query.
My issue is I enter the dates into the combo boxes and try to run my report using the button but I am still prompted to input the start and end dates. Can someone please help?
The names for for the combo boxes are "QtrStartDate" and "QtrEndDate".
Here is the code I have so far:
Code:
'Set date range for report based off form selection
Dim StrWhere As String
StrWhere = "[QtrStartDate]= " & Me.QtrStartDate & "AND [QtrEndDate]= " & Me.QtrEndDate
' Open the report
DoCmd.OpenReport "rpt_2011Q1_ReportingData", acPreview, , StrWhere
Last edited: