Open a report if it's not open?

  • Thread starter Thread starter Les Coover
  • Start date Start date
L

Les Coover

When I open one report I want to check to
see if another report is open. If it is not open
I want to open it. The following is my attempt
at the code. Could someone help me get it?

Thanks, Les

Private Sub Report_Open(Cancel As Integer)

If [Gross Pay Report for 6/14/2002].IsOpen = True Then
End
Else
DoCmd.OpenReport "Gross Pay Report for 6/14/2002", acViewNormal
End If


End Sub


Thanks, Les
 
In recent versions of Access, use:
CurrentProject.AllReports("MyReport").IsLoaded

For older versions, copy the IsLoaded() function from the Utility module of
the Northwind sample database.
 
Thanks Allen, greatly appreciated.

Les


Allen Browne said:
In recent versions of Access, use:
CurrentProject.AllReports("MyReport").IsLoaded

For older versions, copy the IsLoaded() function from the Utility module of
the Northwind sample database.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Les Coover said:
When I open one report I want to check to
see if another report is open. If it is not open
I want to open it. The following is my attempt
at the code. Could someone help me get it?

Thanks, Les

Private Sub Report_Open(Cancel As Integer)
If [Gross Pay Report for 6/14/2002].IsOpen = True Then
End
Else
DoCmd.OpenReport "Gross Pay Report for 6/14/2002", acViewNormal
End If
End Sub
 
Back
Top