Brett Barry: Go Get Geek! replied to Tom van Stiphout
13-Nov-09 11:25 AM

I am using Access 2007 and a connection to a QuickBooks database via
an ODBC driver.
This is the date format for the parameter for filtering reports using
custom dates via DateFrom & DateTo. Otherwise, there is the parameter
DateMacro =3D 'LastCalendarQuarter' etc.
See http://doc.qodbc.com/qodbc/20/reports/sp_report_parameter_values0bbb.ht=
ml?sp_report_name_id=3D1
Before I had someone help me with a form to pull customer data and the
selection on the form was used as the parameter in the stored
procedure:
Private Sub Command7_Click()
Dim strSQL As String
strSQL =3D "sp_report JobEstimatesVsActualsDetail show Text, Label, " &
_
& _
=3D'" & _
Me.CustomerName & "',SummarizeColumnsBy =3D 'TotalOnly'"
Debug.Print strSQL
CurrentDb.QueryDefs("JobEstvsActuals").SQL =3D strSQL
End Sub
However, that was pulling the list of customers via a list box and
selection was done that way.
Perhaps on the form for this project, there are date pickers, one for
the date to and one for the date for and these dates are inserted in
the stored procedure, which is a make-table query to store the
results. Or, I could hard code the dates for each quarter, but there
would have to be some code to fill in the current year (yyyy). This is
eventually going to be used in a report.