Access/VBA Library

GetApplicationTitle

Returns a String expression containing the name of the application.

Syntax

GetApplicationTitle()
Return value

String : Name of the current application.

Code
Function GetApplicationTitle() As String
    Static AppTitle As String
    Dim fs As FileSystemObject
    
    If AppTitle = "" Then
        If PropertyExists("AppTitle") Then
            AppTitle = CurrentDb.Properties("AppTitle")
        Else
            Set fs = New FileSystemObject
            AppTitle = fs.GetBaseName(CurrentDb.name)
        End If
    End If

    GetApplicationTitle = AppTitle
End Function

Remarks

  • If exists the property AppTitle will be the name of the application otherwise the name of the database itself.
  • Because this function probally is called more than once, the application title is stored in a static variable.

See also

  • ShowError