Did you isolate what statement is failing by going into debug? That should
tell you what is wrong.
Does your code compile?
You should also have error handling in ALL your proceduires and functions.
Also, it's not a good idea to have embedded spaces in the name of any Access
object (e.g. table, column , query)
You could try displaying your criteria:
Dim strSQL as string
strSQL = "[Posting Date Year Financial]=" & Me.cbYear & " AND [Quarter]=" &
Me.cbQuarterly
Msgbox strSQL
-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".
"Alan" wrote:
> This is part of my code
>
> Sub PrintReports(ReportView As AcView)
> ' This procedure used in Preview_Click and Print_Click Sub procedures.
> ' Preview or print report selected in the ReportToPrint option group.
> ' Then close the Print Sales Reports Dialog form.
> Dim strReportName As String
> Dim strReportFilter As String
> Dim lOrderCount As Long
>
> ' Determine report filtering
> If Nz(Me.cbReportFilter) <> "" Then
> strReportFilter = "([SalesGroupingField] = """ & Me.cbReportFilter &
> """)"
> End If
>
> ' Determine reporting time frame
> Select Case Me.Listfilter
> Case ByYear
> strReportName = "Yearly Sales Report"
> lOrderCount = DCountWrapper("*", "Sales Analysis", "[Posting Date
> Year Financial]=" & Me.cbYear)
> Case ByQuarter
> strReportName = "Quarterly Sales Report"
> lOrderCount = DCountWrapper("*", "Sales Analysis", "[Posting Date
> Year Financial]=" & Me.cbYear & " AND [Quarter]=" & Me.cbQuarterly)
>
> Every time i click the preview button on my form i get and error
>
> compile erro
>
> method or data member not found
>
> but it work well for Yearly Sales Report, it just highlight
> Quarterly sales report.
>
> An there is a combo box name cbYear Correct spelling
>
> any suggstions
|