Change application startup title programatically

  • Thread starter Thread starter Karen Hart
  • Start date Start date
K

Karen Hart

Can I programatically change Tools, Startup, Application Title
(displayed name on taskbar) depending on what form is open? This is
for an mdb that is distributed as an MDE firmwide.
Tx!
 
Function SetAppTitle(strAppTitle As String) As Boolean

    Dim dbs As DAO.Database
    Const conPropNotFoundError = 3270
    Set dbs = CurrentDb
    On Error GoTo SetAppTitle_Err
    dbs.Properties("AppTitle") = strAppTitle
    SetAppTitle = True

SetAppTitle_Exit:
    Set dbs = Nothing
    Exit Function

SetAppTitle_Err:
    If Err = conPropNotFoundError Then
        Dim prp As DAO.Property
        Set prp = dbs.CreateProperty("AppTitle", dbText, strAppTitle)
        dbs.Properties.Append prp
        Set prp = Nothing
        SetAppTitle = True
    Else
        SetAppTitle = False
    End If
    Resume SetAppTitle_Exit

End Function

HTH

Thank you. Since I know enough about VBA to get me in trouble, where
would this code go? Would I have to put it on the OnLoad property of
every form? Would I set it once somewhere when the mdb opens? Would I
close my eyes and click my heels together 3 times and...??
 
Back
Top