A
Andy
Hi;
Have created a Custom Menu Bar that is displayed when a Report is opened in
Print Preview. When the Report closes the standard Menu Bar is
re-displayed.
OnOpen
Reports.Application.MenuBar = "CustomMenu"
OnClose
Reports.Application.MenuBar = ""
All works correctly when one Report is open/closed. The obstacle to
overcome is when 2 or more Reports are opened. (The user can select more
than one Report to Preview.)
When the first Report is closed the CustomMenu is removed.
I know it is an If/Then statement. What is needed is the code to determine
if a Report is open in Preview.
Tried this, (modified from Help):
Dim obj As AccessObject, dbs As Object
Set dbs = Application.CurrentProject
' Search for open AccessObject objects in AllReports collection.
For Each obj In dbs.ALLREPORTS
If obj.IsLoaded = True Then
Reports.Application.MenuBar = "CustomMenu"
Else
Reports.Application.MenuBar = ""
End If
Next obj
Does anyone have an answer?
Andy
Have created a Custom Menu Bar that is displayed when a Report is opened in
Print Preview. When the Report closes the standard Menu Bar is
re-displayed.
OnOpen
Reports.Application.MenuBar = "CustomMenu"
OnClose
Reports.Application.MenuBar = ""
All works correctly when one Report is open/closed. The obstacle to
overcome is when 2 or more Reports are opened. (The user can select more
than one Report to Preview.)
When the first Report is closed the CustomMenu is removed.
I know it is an If/Then statement. What is needed is the code to determine
if a Report is open in Preview.
Tried this, (modified from Help):
Dim obj As AccessObject, dbs As Object
Set dbs = Application.CurrentProject
' Search for open AccessObject objects in AllReports collection.
For Each obj In dbs.ALLREPORTS
If obj.IsLoaded = True Then
Reports.Application.MenuBar = "CustomMenu"
Else
Reports.Application.MenuBar = ""
End If
Next obj
Does anyone have an answer?
Andy