Is there any function to close all reports when closing a report?
In the OnClose event of one of my open repots i have put the
following code:
Public Function CloseAllReports()
Dim i As Integer
For i = Reports.Count - 1 To 0 Step -1
DoCmd.Close acReport, Reports(i).Name
Next i
Beep
End Function
I do receive however the following mesage:
The action cant be carried out while a form or report is being opened.
I suppose my code is not the right one.
In the OnClose event of one of my open repots i have put the
following code:
Public Function CloseAllReports()
Dim i As Integer
For i = Reports.Count - 1 To 0 Step -1
DoCmd.Close acReport, Reports(i).Name
Next i
Beep
End Function
I do receive however the following mesage:
The action cant be carried out while a form or report is being opened.
I suppose my code is not the right one.