-
Access Reports error
This code had been working for a while, then it just stopped and threw the error 'System.Runtime.InteropServices.COMException' and said "Additional information: Microsoft Access can't find the object 'rptRegionalRegistrationsComparison.'"
The report is there. I don't think I changed anything. Anyone know what's up?
Here's the code
Private Function PrintReport(ByVal strName As String)
Dim dbRWU As New Access.Application()
Dim strPath As String
strPath = "Z:\database.mdb"
dbRWU.Visible = False
'Open Access database
dbRWU.OpenCurrentDatabase(strPath)
'Print report
dbRWU.DoCmd.OpenView(strName)
dbRWU.CloseCurrentDatabase()
dbRWU = Nothing
End Function