Hi,
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):
According to this procedure,If I click on Reports button it will prompt for start and end date.Instead of prompting I want to give input to the stored procedure from two text boxes called tboStartDate and tboEndDate.
The code behind the Reports button is:
Can anyone please help me out of this?
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):
Code:
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:
Code:
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?
Comment