E
eschloss
Access 2003, Win XP
I am trying to automate the display and printing of my reports through a
Form. The reports contain charts which have a Query row source. That Query
contains a parameter for a date range which is set by date options picked on
the Form. Using the SQL and Code below, a blank report is returned when I
click the preview button on the Form.
Query SQL (Name: test_qryfilter):
SELECT L_tblDate.L_Date, tblData_Entry.tblData_Entry_ID, tblData_Entry.Date,
tblData_Entry.Name, tblData_Entry.Part, tblData_Entry.SID, tblData_Entry.Tech
FROM tblData_Entry LEFT JOIN L_tblDate ON tblData_Entry.Date =
L_tblDate.L_Date_ID
WHERE (((L_tblDate.L_Date) Between [forms]![frmReports]![Start_Date_Text]
And [forms]![frmReports]![End_Date_Text]));
Report Chart Row Source SQL (Name: Graph_Actual_Percentage):
TRANSFORM Sum([%]) AS [SumOf%] SELECT [L_Area] FROM [test_qrychart] GROUP
BY [L_Area] PIVOT [L_Tech];
Form Preview_Button_Click Code (Name: frmReports):
Private Sub Preview_Button_Click()
On Error GoTo Err_Preview_Button_Click
Dim stDocName As String
stDocName = "rpttest"
DoCmd.OpenReport stDocName, acPreview, , , acDialog
Exit_Preview_Button_Click:
Exit Sub
Err_Preview_Button_Click:
MsgBox Err.Description
Resume Exit_Preview_Button_Click
End Sub
On the Form, both 'Start_Date_Text' and 'End_Date_Text' have "Short Date"
formats. What am I doing wrong? Please guide me in the right direction.
I am trying to automate the display and printing of my reports through a
Form. The reports contain charts which have a Query row source. That Query
contains a parameter for a date range which is set by date options picked on
the Form. Using the SQL and Code below, a blank report is returned when I
click the preview button on the Form.
Query SQL (Name: test_qryfilter):
SELECT L_tblDate.L_Date, tblData_Entry.tblData_Entry_ID, tblData_Entry.Date,
tblData_Entry.Name, tblData_Entry.Part, tblData_Entry.SID, tblData_Entry.Tech
FROM tblData_Entry LEFT JOIN L_tblDate ON tblData_Entry.Date =
L_tblDate.L_Date_ID
WHERE (((L_tblDate.L_Date) Between [forms]![frmReports]![Start_Date_Text]
And [forms]![frmReports]![End_Date_Text]));
Report Chart Row Source SQL (Name: Graph_Actual_Percentage):
TRANSFORM Sum([%]) AS [SumOf%] SELECT [L_Area] FROM [test_qrychart] GROUP
BY [L_Area] PIVOT [L_Tech];
Form Preview_Button_Click Code (Name: frmReports):
Private Sub Preview_Button_Click()
On Error GoTo Err_Preview_Button_Click
Dim stDocName As String
stDocName = "rpttest"
DoCmd.OpenReport stDocName, acPreview, , , acDialog
Exit_Preview_Button_Click:
Exit Sub
Err_Preview_Button_Click:
MsgBox Err.Description
Resume Exit_Preview_Button_Click
End Sub
On the Form, both 'Start_Date_Text' and 'End_Date_Text' have "Short Date"
formats. What am I doing wrong? Please guide me in the right direction.