[AccessD] A2K: Dim DAO.Recordset

William Hindman wdhindman at bellsouth.net
Mon Mar 24 21:26:24 CST 2003


Darren

...dao reports don't support the recordset property ...instead, you have to
set the recordsource property to the name property of the recorset's source
table, query, or select statement ...HTH :)

Set rs = db.OpenRecordset("SourceQueryName", dbOpenDynaset)
Me.RecordSource = rs.Name

William Hindman
"All it takes for evil to prevail is for good men to do nothing." Edmund
Burke


----- Original Message -----
From: "Darren DICK" <d.dick at uws.edu.au>
To: "AccessD List" <AccessD at databaseadvisors.com>
Sent: Monday, March 24, 2003 10:07 PM
Subject: [AccessD] A2K: Dim DAO.Recordset


> Hello all
> Why does...
> Dim rs As DAO.Recordset
> Set rs = Me.Recordset
> work fine in a form but not in a report in the same dB?
>
> eg on form
>
> Private Sub Form_Load()
> Dim rs As DAO.Recordset
> Set rs = Me.Recordset
> Debugs fine
> but in a report
>
> Private Sub Report_Open()
> Dim rs As DAO.Recordset
> Set rs = Me.Recordset
> or
> Set rs = Me.RecordSource
>
> When I debug, it fails on the = Me.Recordset bit
> and an error msg says
> Compile error.
> Method or data member not found.
>
> or if I use RecordSource it fails on the = Me.RecordSource bit
> and an error msg says
> Compile error.
> Type Mismatch
>
> Can't I set a recordset for a report??
>
> Many thanks in advance
>
> Darren
>
>
>
>
>
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>




More information about the AccessD mailing list