Application Object.
The RefreshTitleBar method refreshes the Microsoft Access title bar after the AppTitle or AppIcon property has been set in Visual Basic. For example, you can change the caption in the Microsoft Access title bar to “Contacts Database” by setting the AppTitle property. In order for this change to take effect, you must subsequently use the RefreshTitleBar method.
Application.RefreshTitleBar
The RefreshTitleBar method uses the following argument.
Argument |
Description |
Application |
The Application object. |
The AppTitle and AppIcon properties enable you to customize your application by changing the title and icon that appear in the Microsoft Access title bar. The title bar is not automatically updated after you have set these properties. In order for the change to the title bar to appear, you must use the RefreshTitleBar method.
You can reset the AppTitle and AppIcon properties to their default value by deleting them from the Properties collection of the Database object representing the current database. After you delete these properties, you must use the RefreshTitleBar method to restore the Microsoft Access defaults to the title bar.
The following example sets the AppTitle property of the current database and applies the RefreshTitleBar method to update the title bar.
Sub ChangeTitle() Dim dbs As Database, prp As Property Const conPropNotFoundError = 3270 On Error GoTo ErrorHandler ' Return Database variable pointing to current database. Set dbs = CurrentDb ' Change title bar. dbs.Properties!AppTitle = "Contacts Database" ' Update title bar on screen. Application.RefreshTitleBar Exit Sub : If Err.Number = conPropNotFoundError Then Set prp = dbs.CreateProperty("AppTitle", dbText, _ "Contacts Database") dbs.Properties.Append prp Else MsgBox "Error: " & Err.Number & vbCrLf & Err.Description End If Resume NextSub