Private Sub Report_Open(Cancel As Integer)
Dim ClientsRS As ADODB.Recordset
Set ClientsRS = CurrentDb.OpenRecordset("Clients")
ClientsRS.Open ("Clients")
End Sub
Can someone send me some code that will?
That would depend on what you wanted it to do, wouldn't it? On the off
chance that you want to open a DAO recordset, you could try
Dim ClientsRS As DAO.Recordset
Set ClientsRS = CurrentDb.OpenRecordset("Clients")
Though why you would be opening it in your report's Open event, but not
doing anything with it, is a mystery.
One could alternatively guess that you wanted to open an ADODB
recordset, in which case it might be like this (though I'm not all that
familiar with ADO):
Dim ClientsRS As ADODB.Recordset
ClientsRS.Open "Clients", CurrentProject.Connection, , , adCmdTable
But really, your question amounts to "My car doesn't work. What's wrong
with it?"