Results 1 to 2 of 2
  1. #1
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496

    Function to close reports

    I am trying to do a function

    Code:
    Function checkReportClosed(ReportName As String)
    
    
    If CurrentProject.AllReports(ReportName).IsLoaded Then
    Reports!report(ReportName).Close
    End If
    
    
    End Function
    the idea is when the string name of the report is passed on and it happens to be open it closes

    but I can't get it to work because I don't know how to get reports! etc to work

    the report opens in the background

  2. #2
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    woops

    sorted

    Code:
    Function checkReportClosed(ReportName As String)
    
    
    If CurrentProject.AllReports(ReportName).IsLoaded Then
    Application.DoCmd.SelectObject acReport, ReportName
    DoCmd.Close
    End If
    
    
    End Function

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 8
    Last Post: 01-31-2014, 01:45 PM
  2. Replies: 4
    Last Post: 01-31-2014, 11:47 AM
  3. Replies: 9
    Last Post: 01-03-2012, 01:58 AM
  4. Replies: 2
    Last Post: 06-20-2011, 03:10 PM
  5. Reports w/ sub-reports very slow to open
    By vaikz in forum Reports
    Replies: 2
    Last Post: 02-27-2011, 08:41 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums