I am trying to set a report's recordset property with an ADO recordset.
I do the following and it works on a form. What do I need to do to do
this correctly on a report?
Private Sub Report_Open(Cancel As Integer)
Dim c As ADODB.Connection
Dim r As ADODB.Recordset
Dim strS As String
Set c = New ADODB.Connection
Set r = New ADODB.Recordset
strS = <a valid SQL statement>
With c
.CursorLocation = adUseClient
.ConnectionString = cTmarConnect 'constant for a connect string
.Open
End With
With r
.ActiveConnection = c
.CursorType = adOpenDynamic
.LockType = adLockReadOnly
.Open strS
End With
Set Me.Recordset = r
End Sub
This works fine on a form - take the exact same code and place in the on
open event of a form and I get the results I expect. In a report, I get
an error message that tells me
Run time error '2593'
This feature is not available in an mdb.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me