The Microsoft documentation you can download from this link:
http://support.microsoft.com/kb/q301987/
shows how to deal with ADO in combination with reports for the NorthwindCS.adp sample databse:
1. Open the sample project NorthwindCS.adp.
2. Open the Customer Labels report in Design view.
3. Clear the RecordSource property so that the report is unbound.
4. Add the following code to the report's Open event procedure:
-
Private Sub Report_Open(Cancel As Integer)
-
Dim cn As ADODB.Connection
-
Dim rs As ADODB.Recordset
-
-
'Use the ADO connection that Access uses
-
Set cn = CurrentProject.AccessConnection
-
-
'Create an instance of the ADO Recordset class and open it
-
Set rs = New ADODB.Recordset
-
rs.Open "SELECT * FROM Customers WHERE CustomerID LIKE 'a%'", cn
-
-
'Set the report's Recordset property to the ADO recordset
-
Set Me.Recordset = rs
-
Set rs = Nothing
-
Set cn = Nothing
-
End Sub
-
5. Press ALT+F11 to return to Microsoft Access.
6. Save the report, and then close it.
7. Print preview the Customer Labels report.
There's however also another solution by creating a so-called "Pass through" query. Such a query needs to be in the original database's SQL syntax, but offers the advantage that only the SQL is passed to the database and only the selected rows will be returned. The ADO connection will grab all rows and Access will do the selection afterwards. Certainly advisable to look into the "Pass through" (See also the F1 helpfile) when you're working in a networking environment.
Nic;o)