S
Sheldon Penner
I have been trying to build a report based on a crosstab query by running the
query, then setting the resulting recordset as the report's recordset. On
the line that sets the report's recordset property, I get runtime error 2593:
"This feature is not available in an MDB."
Here's my code:
Private Sub Report_Open(Cancel As Integer)
Dim db As DAO.Database
Dim qdf As DAO.QueryDef
Dim param As DAO.Parameter
Dim rs As DAO.Recordset
Dim fld As DAO.Field
Dim n As Integer
Set db = CurrentDb
Set qdf = db.QueryDefs("qCodeReviewRequestID")
Set param = qdf.Parameters![Enter RequestID]
'param.Value = Forms("fmRequestList").requestID
param.Value = 473
Set rs = qdf.OpenRecordset(dbOpenSnapshot)
'*** THIS IS THE LINE THAT GETS THE ERROR ***
Set Me.Recordset = rs
For n = 0 To rs.Fields.Count - 3
Me.Controls("txtIssue" & n).ControlSource = rs.Fields(n + 2).Name
Me.Controls("Issue" & n).Caption = DLookup("CodeReviewIssue",
"lkpCodeReviewIssue", "CodeReviewIssueID=" & rs.Fields(n + 2).Name)
Next
End Sub
Thank you in advance for your help.
query, then setting the resulting recordset as the report's recordset. On
the line that sets the report's recordset property, I get runtime error 2593:
"This feature is not available in an MDB."
Here's my code:
Private Sub Report_Open(Cancel As Integer)
Dim db As DAO.Database
Dim qdf As DAO.QueryDef
Dim param As DAO.Parameter
Dim rs As DAO.Recordset
Dim fld As DAO.Field
Dim n As Integer
Set db = CurrentDb
Set qdf = db.QueryDefs("qCodeReviewRequestID")
Set param = qdf.Parameters![Enter RequestID]
'param.Value = Forms("fmRequestList").requestID
param.Value = 473
Set rs = qdf.OpenRecordset(dbOpenSnapshot)
'*** THIS IS THE LINE THAT GETS THE ERROR ***
Set Me.Recordset = rs
For n = 0 To rs.Fields.Count - 3
Me.Controls("txtIssue" & n).ControlSource = rs.Fields(n + 2).Name
Me.Controls("Issue" & n).Caption = DLookup("CodeReviewIssue",
"lkpCodeReviewIssue", "CodeReviewIssueID=" & rs.Fields(n + 2).Name)
Next
End Sub
Thank you in advance for your help.