Store the function in a standard module (perhaps add the prefix Public
Function... to be clear that the function is available anywhere in your
database) then you can use it where you want with syntax: SetAppTitle
"MyAppTitle". Within a VBA procedure that opens (or closes) a form, in a
form's Open or Close event, at application start using an autoexec Macro
with the RunCode action etc.
HTH
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...??