I have created a command button called Reports in Access 2007 using wizard for generating a report between two dates.The stored procedure behind the button is spr_Reports(SQL server 2008):
Expand|Select|Wrap|Line Numbers
- ALTER PROCEDURE [dbo].[spr_Reports]
- @start_date date,@end_date date
- AS
- BEGIN
- select convert(varchar(20),date,103)as Date,d.Planned,d.Comment
- from tbl_Calendar e join tbl_Calendar_Details d
- on e.Calendar_ID=d.Calendar_ID
- where Date between @start_date and @end_date order by Date asc
- END
The code behind the Reports button is:
Expand|Select|Wrap|Line Numbers
- Private Sub CmdReports_Click()
- On Error GoTo Err_CmdReports_Click
- Dim stDocName As String
- stDocName = "dbo.spr_Reports"
- DoCmd.OpenStoredProcedure stDocName, acViewNormal, acEdit
- Exit_CmdReports_Click:
- Exit Sub
- Err_CmdReports_Click:
- MsgBox Err.Description
- Resume Exit_CmdReports_Click
- End Sub
Can anyone please help me out of this?