Property .Recordset of Reports

M

Marcus Becker

I have created an unbound ADO-Recordset that i want to take as the
RecordSource (or Recordset) of a report:

Dim rst As New Recordset

With rst
.Fields.Append "Name", adVarChar, 255
.Fields.Append "Menge", adInteger
.Fields.Append "Nummer", adInteger
....etc
.Open

Filled with values:

.AddNew
!Nummer = intx
!Name = rstbest!Name
!Menge = 500
....etc.
.Update


and in the end:

DoCmd.OpenReport "rpt_ausgabe", acViewPreview
reports!rpt_ausgabe.recordset = rst
.Close
End With

which produces the error:
Run-time error '2593': This feature is not available in an MDB.

Does anybody know how to make this work? The knowlegde base isn't very
helpful.

Thanks
 
G

George Nicholson

recordset is an object and requires the use of Set during assignment:

Set reports!rpt_ausgabe.recordset = rst

I can't guarantee this will solve all your problems, but at least it
reduces them by one. :)

DAO vs ADO strikes me as another problematic area. Recordset is in both
object models and while you state "I have created an unbound ADO-Recordset"
it looks pretty much like DAO to me. Access might need that issue clarified
as well...
 
M

Marcus Becker

Am Mon, 28 Feb 2005 11:41:57 -0600 schrieb George Nicholson
recordset is an object and requires the use of Set during assignment:

Set reports!rpt_ausgabe.recordset = rst

I can't guarantee this will solve all your problems, but at least it
reduces them by one. :)

You're right, of course ...
DAO vs ADO strikes me as another problematic area. Recordset is in both
object models and while you state "I have created an unbound
ADO-Recordset" it looks pretty much like DAO to me. Access might need
that issue clarified as well...

So I changed it to

Dim rst As New ADODB.Recordset

But the error message is still the same ...
 

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