1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
Sub ChangeTitle()
Dim obj As Object
Const conPropNotFoundError = 3270
On Error GoTo ErrorHandler
' Return Database object variable pointing to
' the current database.
Set dbs = CurrentDb
' Change title bar.
dbs.Properties!AppTitle = "Contacts Database"
' Update title bar on screen.
Application.RefreshTitleBar
Exit Sub
ErrorHandler:
If Err.Number = conPropNotFoundError Then
Set obj = dbs.CreateProperty("AppTitle", dbText, "Contacts Database")
dbs.Properties.Append obj
Else
MsgBox "Error: " & Err.Number & vbCrLf & Err.Description
End If
Resume Next
End Sub |
Partager