VBA, MS Access MS Access в примерах

Проверка - Открыт ли Отчёт? (IsReportLoaded)

Public Function IsReportLoaded(sReportName$) As Boolean
' Determines whether the Report is loaded
' Returns:
' True - if the Report is loaded and is not in revision mode;
' False - if the Report is not loaded or is in revision mode.
'--------------------------------------------------------------------------
' Arguments:
'   sFormName = Report name
'--------------------------------------------------------------------------
On Error GoTo IsReportLoaded_Err
    If CurrentProject.AllReports(sReportName).IsLoaded Then
        If CurrentProject.AllReports(sReportName).CurrentView > 0 Then '0 = Design view
            IsReportLoaded = True
        End If
    End If

IsReportLoaded_Bye:
    Exit Function

IsReportLoaded_Err:
    Err.Clear
    Resume IsReportLoaded_Bye
End Function
Назад ToTop
L.E. 04.03.2022
Рейтинг@Mail.ru