B
bipin
Hello,
I have a table of reports and the functions that must run
before the report is opened.
Set db = DBEngine(0)(0)
sSQL = "SELECT DISTINCTROW tblReportSelect.CompanyID, " & _
"tblReports.ReportID, tblReports.ReportName, " & _
"tblReports.ActualName, tblReports.FuncName " & _
"FROM tblReportSelect INNER JOIN tblReports ON " & _
"tblReportSelect.ReportID = tblReports.ReportID " & _
"WHERE (((tblReportSelect.CompanyID)=" & [Forms]!
[frmReports]![cboComp] & "));"
Set rsReports = db.OpenRecordset(sSQL, dbOpenSnapshot)
Do Until rsReports.EOF
If Not IsNull(rsReports!FuncName) Then
Debug.Print rsReports!FuncName
' errors here:
Eval (rsReports!FuncName)
End If
DoCmd.OpenReport (rsReports!ActualName), A_NORMAL ' A_PREVIEW
DoEvents
rsReports.MoveNext
Loop
rsReports.Close
now the eval function will not run the function. the same code works
fine
in AC97. but in AC2007 i get the following error:
Run-time error '2482':
Microsoft Office Access can't find the name 'ClassMerchPrep' you
entered
in the expression.
the function runs fine outside of the eval function. Are there any
alternatives
to the eval function?
Thanks,
Bipin
I have a table of reports and the functions that must run
before the report is opened.
Set db = DBEngine(0)(0)
sSQL = "SELECT DISTINCTROW tblReportSelect.CompanyID, " & _
"tblReports.ReportID, tblReports.ReportName, " & _
"tblReports.ActualName, tblReports.FuncName " & _
"FROM tblReportSelect INNER JOIN tblReports ON " & _
"tblReportSelect.ReportID = tblReports.ReportID " & _
"WHERE (((tblReportSelect.CompanyID)=" & [Forms]!
[frmReports]![cboComp] & "));"
Set rsReports = db.OpenRecordset(sSQL, dbOpenSnapshot)
Do Until rsReports.EOF
If Not IsNull(rsReports!FuncName) Then
Debug.Print rsReports!FuncName
' errors here:
Eval (rsReports!FuncName)
End If
DoCmd.OpenReport (rsReports!ActualName), A_NORMAL ' A_PREVIEW
DoEvents
rsReports.MoveNext
Loop
rsReports.Close
now the eval function will not run the function. the same code works
fine
in AC97. but in AC2007 i get the following error:
Run-time error '2482':
Microsoft Office Access can't find the name 'ClassMerchPrep' you
entered
in the expression.
the function runs fine outside of the eval function. Are there any
alternatives
to the eval function?
Thanks,
Bipin