VBA/Excel/Access/Word/Language Basics/ActiveForm — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Версия 16:33, 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