MartyConnelly
martyconnelly at shaw.ca
Sat Feb 12 14:29:20 CST 2005
I know of two workarounds, it does this in Access 2003 too Your own msgbox wrapper function as below or this way ?Eval("msgbox(""Hello"")") Problem is described and explained by Dev Ashish http://www.mvps.org/access/bugs/bugs0035.htm Public Function MyMsgBox(ByVal strPrompt As String, ByVal lngButtons As Long, Optional ByVal varTitle As Variant) As Long Static strAppTitle As String If IsMissing(varTitle) Then If Len(strAppTitle) = 0 Then strAppTitle = CurrentDb().Properties("AppTitle") varTitle = strAppTitle End If MyMsgBox = MsgBox(strPrompt, lngButtons, varTitle) End Function Borge Hansen wrote: >For those of you toiling on the weekend: > >This is something that has annoyed me for a while. > >I've set the database property Apptitle. >Both in the startup dialog window and in code on startup >This is the code for setting the Apptitle: > >*************** >Sub ChangeTitle() > Dim Obj As Object > Dim dbs As DAO.Database > Dim strAppTitle As String > > Const conPropNotFoundError = 3270 > strAppTitle = DLookup("AppTitle", "USystblsysvar") > > On Error GoTo ErrorHandler > Set dbs = CurrentDb > dbs.Properties!AppTitle = strAppTitle > Application.RefreshTitleBar > Exit Sub > >ErrorHandler: > If Err.Number = conPropNotFoundError Then > Set Obj = dbs.CreateProperty("AppTitle", dbText, strAppTitle) > dbs.Properties.Append Obj > Else > MsgBox "Error: " & Err.Number & vbCrLf & Err.Description > End If > Resume Next >End Sub >*********************** > >The Application Name appears in the database window. > >In Access97 the Application Name would also appear on the title bar of all the message dialog boxes, instead of "Microsoft Access" > >This doesn't happen in AccessXP > >WHY NOT??? > >In the Help section for Msgbox it says: > >Syntax >MsgBox(prompt[, buttons] [, title] [, helpfile, context]) > >bla bla ... and then > > title Optional. String expression displayed in the title bar of the dialog box. If you omit title, the application name is placed in the title bar. > > >Help on Apptitle says in the remarks section: > >Remarks >If this property isn't set, the string "Microsoft Access" appears in the title bar. > >This property's setting takes effect immediately after setting the property in code (as long as the code includes the RefreshTitleBar method) or closing the Startup dialog box. > >What am I missing here? > >Borge > > > > -- Marty Connelly Victoria, B.C. Canada