problem setting report recordset in code

D

Derek Agar

Hello,
I ran into a problem with an Access 2002 ADP and setting a reports
recordset in code.
I could set the RecordSource to the stored procedure and manually put
in the InputParameters and it worked fine. But if I make the report
unbound and then set the recordset in the report_open event, no such
luck. (came back saying no records by calling the report_nodata
event)
Here is the code used in the report_open event:
....
Set cmd = New ADODB.Command
Set cmd.ActiveConnection = gadoFrontEnd
cmd.CommandType = adCmdStoredProc
cmd.CommandText = "qryHB_LiquidOrder"
cmd.Parameters("@DateFrom").Value = mdatStart
cmd.Parameters("@DateTo").Value = mdatStop
Set Me.Recordset = cmd.Execute
....
Now, I have done the same thing with another report and it works
there. The only difference being a different stored procedure.
That makes me believe that it has something to do with the stored
procedure and Access. Anyone else run into this weird issue? What
did you do to fix it?
Thanks
Derek Agar
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top