Is there anyway to determine if a specific report is already open? I have a form that adds filters to my report and if it is already open, the filters don't get applied the second time. Any ideas? Thanks!!
Dim accApp as Access.Application
Set accApp = GetObject(, "Access.Application"
With accApp
For Each Report in accApp.Reports
MsgBox("A report is open!"
If (Report.Name = stDocName) Then
MsgBox ("This report is the one you're
trying to open!"
Report.Close
End If
Next Report
End With
Theoretically this should be somewhere in the ballpark, but it's not really working out. When I have a report open (not the one I'm looking for), I get stuck in an infinite loop that keeps saying "A report is open!" Any ideas? Thanks!
Thanks! That works great! What would be the syntax to close a report that is already open? I tried adding: rpt.Close inside the for loop, but that's not a valid command. Any ideas? Thanks!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.