VBA/Excel/Access/Word/Language Basics/ActiveForm — различия между версиями

Материал из VB Эксперт
Перейти к: навигация, поиск
м (1 версия)
 
(нет различий)

Текущая версия на 12:46, 26 мая 2010

Working with the Screen Object

 
Sub screen()
    On Error Resume Next
    
    Dim strName As String
    Dim strType As String
    strType = "Form"
    strName = ActiveForm.Name
    If Err = 2475 Then
    
        Err = 0
        strType = "Report"
        strName = ActiveReport.Name
        If Err = 2476 Then
            Err = 0
            strType = "Data access page"
            strName = ActiveDataAccessPage.Name
            If Err = 2022 Then
                Err = 0
                strType = "Datasheet"
                strName = ActiveDatasheet.Name
            End If
        End If
    End If
    Debug.Print "The current Screen object is a " & strType & "Screen object name: " & strName
End Sub