G
Guest
There are two reports in a value list text field and also a text field with
a list of quarters on a form,like, "FY 01/07, FY12/06, FY11/06 etc. This
code opens the report based on a query but it doesn't filter it. In the
query of the report I have this same fiscal year period field. The field is
called FY Reported but that is a typo it is really the Fiscal Quarter I don't
want to change anything.
How do I apply the filter in the code? The Select query would be something
like:
Select * from queryXXX WHERE [FY Reported] = me.fiscalQtr?
Where do I put the select query and how do I apply the filter so it opens
the report with only the quarter requested?
Private Sub cmdGetReport_Click()
'On Error GoTo Err_cmdMediatorEvalCum_Click
Dim stDocName As String
Dim stFiscalQtr As String
Dim strFilter As String
stDocName = Me.ReportName
stFiscalQtr = Me.FiscalQtr
DoCmd.OpenReport stDocName, acPreview, , strFilter
ApplyFilter
End Sub
THANKS!
a list of quarters on a form,like, "FY 01/07, FY12/06, FY11/06 etc. This
code opens the report based on a query but it doesn't filter it. In the
query of the report I have this same fiscal year period field. The field is
called FY Reported but that is a typo it is really the Fiscal Quarter I don't
want to change anything.
How do I apply the filter in the code? The Select query would be something
like:
Select * from queryXXX WHERE [FY Reported] = me.fiscalQtr?
Where do I put the select query and how do I apply the filter so it opens
the report with only the quarter requested?
Private Sub cmdGetReport_Click()
'On Error GoTo Err_cmdMediatorEvalCum_Click
Dim stDocName As String
Dim stFiscalQtr As String
Dim strFilter As String
stDocName = Me.ReportName
stFiscalQtr = Me.FiscalQtr
DoCmd.OpenReport stDocName, acPreview, , strFilter
ApplyFilter
End Sub
THANKS!