Application Property

Applies To   ActiveX control, Bound Object Frame control, Chart control, Check Box control, Combo Box control, Command Button control, Controls collection, Form, Form section, Forms collection, Image control, Label control, Line control, List Box control, Module object, Modules collection, Option Button control, Option Group control, Page, Page Break control, Properties collection, Rectangle control, Report section, Reports collection, Screen object, Subform/Subreport control, Tab control, Text Box control, Toggle Button control, Unbound Object Frame control.

Description

You can use the Application property in Visual Basic to access the active Microsoft Access Application object and its related properties.

Setting

The Application property is set by Microsoft Access and is read-only in all views.

Remarks

Each Microsoft Access object has an Application property that returns the current Application object. You can use this property to access any of the object's properties. For example, you could refer to the menu bar for the Application object from the current form by using the following syntax:

Me.Application.MenuBar
See Also

Application object.

Example

The following example displays the DBEngine properties in a message box.

Private Sub Command1_Click()
    DisplayApplicationInfo Me
End Sub

Function DisplayApplicationInfo(obj As Object) As Integer
    Dim objApp As Object, intI As Integer, strProps As String
    On Error Resume Next
        ' Form Application property.
        Set objApp = obj.Application
        MsgBox "Application Visible property = " & objApp.Visible
        If objApp.UserControl = True Then
        For intI = 0 To objApp.DBEngine.Properties.Count - 1
            strProps = strProps & objApp.DBEngine.Properties(intI).Name _
                & ", "
        Next intI
        End If
        MsgBox Left(strProps, Len(strProps) - 2) & ".", vbOK, _
            "DBEngine Properties"
End Function