I am using stored procedure's recordset as record source for the report(in Ms Access .adp), but could not preview the report.
here is my code
str2 = "Report1" ' report i created
DoCmd.OpenReport str2, acViewDesign
Set rpt1 = Reports("Report1"
rpt1.RecordSource = rs1.Source 'record set from sp
DoCmd.CLOSE , , acSaveYes
'Open report for viewing
DoCmd.OpenReport "Report1", acViewPreview 'Error this line
DoCmd.Echo True
here is my code
str2 = "Report1" ' report i created
DoCmd.OpenReport str2, acViewDesign
Set rpt1 = Reports("Report1"
rpt1.RecordSource = rs1.Source 'record set from sp
DoCmd.CLOSE , , acSaveYes
'Open report for viewing
DoCmd.OpenReport "Report1", acViewPreview 'Error this line
DoCmd.Echo True