Hi everyone,

I have an Access2000 report which I pass in the date via VBA to stored procedure. I want the recordset return from sp to be the report's recordsource in report's open event. I'm using AC2000.
sub Report_Open(Cancel As Integer)
With get_completed_samples
.ActiveConnection = CurrentProject.Connection
.CommandText = "spGet_completed_samples"
.CommandType = adCmdStoredProc
.Parameters.Append .CreateParameter("ret_val", adInteger, adParamReturnValue)
.Parameters.Append .CreateParameter("@dt", adDate, adParamInput, 10, Forms!date_range_sampling_sched!Beginning_date)
.Parameters.Append .CreateParameter("@dte", adDate, adParamInput, 10, Forms!date_range_sampling_sched!Ending_date)
Set rst = .Execute
End With

***Me.RecordSource = rst
end sub