S
swedbera
Hi,
I've used this same code in Access 2000 to build a report list, but now in
Access XP it will not work. I receive the following error message:
Object doesn't support this property or method. Error 438
I've researched the error, but I haven't found anything helpful. Can
someone help me with this please???
Arlene
Public Sub BuildReportList()
On Error GoTo ErrHandler
Dim objReport As AccessObject
Dim strReportName, strReportCaption As String
DoCmd.SetWarnings False
DoCmd.RunSQL "DELETE * FROM [Report List]"
For Each objReport In CurrentProject.AllReports
DoCmd.OpenReport objReport.NAME, acViewDesign
With Reports(objReport.NAME)
If Not objReport.NAME Like "srpt*" Then
strReportName = objReport.NAME
strReportCaption = objReport.Caption
DoCmd.RunSQL "INSERT INTO [Report List]
([ReportName],[ReportCaption]) VALUES (strReportName,strReportCaption)"
DoCmd.Close acReport, objReport.NAME, acSaveNo
End If
End With
Next objReport
DoCmd.SetWarnings True
ExitHandler:
Exit Sub
ErrHandler:
DoCmd.SetWarnings True
MsgBox "Please record this information: " & Err.Description & " " &
Err.Number & " " & Err.Source, vbCritical
Resume ExitHandler
End Sub
I've used this same code in Access 2000 to build a report list, but now in
Access XP it will not work. I receive the following error message:
Object doesn't support this property or method. Error 438
I've researched the error, but I haven't found anything helpful. Can
someone help me with this please???
Arlene
Public Sub BuildReportList()
On Error GoTo ErrHandler
Dim objReport As AccessObject
Dim strReportName, strReportCaption As String
DoCmd.SetWarnings False
DoCmd.RunSQL "DELETE * FROM [Report List]"
For Each objReport In CurrentProject.AllReports
DoCmd.OpenReport objReport.NAME, acViewDesign
With Reports(objReport.NAME)
If Not objReport.NAME Like "srpt*" Then
strReportName = objReport.NAME
strReportCaption = objReport.Caption
DoCmd.RunSQL "INSERT INTO [Report List]
([ReportName],[ReportCaption]) VALUES (strReportName,strReportCaption)"
DoCmd.Close acReport, objReport.NAME, acSaveNo
End If
End With
Next objReport
DoCmd.SetWarnings True
ExitHandler:
Exit Sub
ErrHandler:
DoCmd.SetWarnings True
MsgBox "Please record this information: " & Err.Description & " " &
Err.Number & " " & Err.Source, vbCritical
Resume ExitHandler
End Sub