VBA checking something is open

Discussion in 'OT Technology' started by pimphat, Mar 12, 2005.

  1. pimphat

    pimphat hmmm

    Joined:
    Sep 18, 2002
    Messages:
    5,701
    Likes Received:
    0
    Location:
    Australia
    How would I go about checking that a report is open in MS Access? If the report is not open I can't perform certain functions on the report so I'd like to have an IF statement to prevent errors.
     
  2. SLED

    SLED build an idiot proof device and someone else will

    Joined:
    Sep 20, 2001
    Messages:
    28,118
    Likes Received:
    0
    Location:
    AZ, like a bauce!
    Code:
    For Each rpt In Reports
        If rpt.Name = "rptCustom" Then
            MsgBox "Report is open. Please close and try again."
            Exit For
        End If
    Next
    .
     
  3. SLED

    SLED build an idiot proof device and someone else will

    Joined:
    Sep 20, 2001
    Messages:
    28,118
    Likes Received:
    0
    Location:
    AZ, like a bauce!
    man, that looks like shit... but it works. Wonder why the [ code ] tags aren't formatting correctly.
     

Share This Page