text: Overriding built-in Microsoft Access Functions: Giving the MsgBox a Default Title - CodeProject
  Overriding built-in Microsoft Access Functions: Giving the MsgBox a Default Title
  14 Jun 2016CPOL2 min read
  If you ever used a MsgBox in a Microsoft Access application, you probably noticed that it always says "Microsoft Access" in the title bar by default:
  If you want to hide the fact that your app was built with Microsoft Access, and show your app title instead, you can use the Title parameter:
  MsgBox "Hello World", , "My App"
  But that's not the ideal solution.
  Even when you put the app title into a constant and pass this, you still have to remember to do this every time you're using a MsgBox.
  Fortunately, there's a better way: It's possible to "override" default Access functions.
  You can provide your own implementation with the same name and the same parameters, which calls the actual built-in function under the hood.
  Here's an example of how to override MsgBox:
  Prompt, _
  Optional Title, _
  Optional HelpFile, _
  Optional Context _
  If IsMissing(Title) Then
  Title = CurrentDb.Properties("AppTitle")
  MsgBox = VBA.Interaction.MsgBox(Prompt, Buttons, Title, HelpFile, Context)
  This function doesn't do much more than passing all parameters to VBA.Interaction.MsgBox, which is what you would call the fully qualified name in .NET for MsgBox.
  You can see it when you right-click MsgBox somewhere in your code and click on "Go to definition":
  Now you just need to set the app title once, if your application doesn't have one yet.
  The MSDN page about the AppTitle property describes multiple ways how to do this (manually or by code).
  In case the AppTitle property already exists in your app, you can just overwrite it with a one-liner:
  CurrentDb.Properties("AppTitle")= "New Title"
  If it doesn't, there's also example code on the bottom of this MSDN page which creates the property if it's missing.
  With the app title set, the message box will now look like this, without having to fill the Title parameter:
  Note that there's no error handling in the MsgBox function shown above, i.e., it will crash when your app title is not set.
  It would be possible to avoid this by catching error number 3270 or by looping CurrentDb.Properties and checking each property whether its name is AppTitle, but for me that's not necessary, because I control the app and I know the title is set.
  This approach works for other built-in Access functions as well.
  Another good candidate for this is the InputBox:
  Optional Default, _
  Optional XPos, _
  Optional YPos, _
  InputBox = VBA.Interaction.InputBox(Prompt, Title, Default, XPos, YPos, HelpFile, Context)
  You can even add this in an existing app without having to change anything else, as long as you make sure that your "overridden" function's signature is exactly the same as the original Microsoft Access function.
  This article was originally posted at http://christianspecht.de/2016/06/14/overriding-built-in-ms-access-functions-giving-the-msgbox-a-default-title
  DarrenWheatley16-Jun-16 22:04
  DarrenWheatley 16-Jun-16 22:04
  I tried this but couldn't set the AppTitle property, getting the error Runtime Error '3270': Property not found. My guess is this only works from a certain release. We're still on 2010 here. To be fair, I still made it work by hardcoding the app title into the function, so thanks.