Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is the report open????

Status
Not open for further replies.

marydn

Programmer
Mar 26, 2001
152
US
How do I check to see if the report is open? I want to be able to check if a report is open and if so close it so that the user can open the report again, but with different criteria.

Thanks!!!
 
Here is the function:

Function ReportIsLoaded(MyReportName As String) As Boolean
'
' Determines if a Report is loaded.
'
Dim i As Integer
ReportIsLoaded = False
For i = 0 To Reports.Count - 1
If Reports(i).Name = MyReportName Then
ReportIsLoaded = True
Exit Function ' Quit function once form has been found.
End If
Next i
End Function


Here is how to call the function:

If IsLoaded.ReportIsLoaded("Report_Name") Then
DoCmd.Close acReport "Report_Name"
End If

HTH
 
Toe - Thanks it worked well!!!!!!!!!!! :)))
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top