Message Box Replacement for MS Access
(and VBA. Free)
This project provides a custom and enhanced message box replacement for the default MsgBox found in Access.
A accdb demo database with a Your-Code-Wizard containing all the code for Access 2007/2010/2013/2016/365(2019) for 32bit and 64bit is available below!
This is not a tool I created myself, but I put quite some work into improving it. I tried to contact the original developer Renaud Bompuis and made the update available to him, but I also wanted to make sure it's available from here.
Renaud explains very good how easy it is to replace the original msgbox with his dialog.box or dialog.richbox - the latter displaying Access richt text format.
The improvements I made over his original 1.10 version are documented at the bottom of this page in detail.
You can download the demo database in accdb format here. If you change anything, especially improve the code, please send me an update. Also make sure to leave credits and links to Renauds and my page in the code.
You need to grab all files from the file you download and copy them into your own application (there is another module in the demo database - compared to Renaud's version)!
So let's see what the improved version can do for you. In the first picture you see the base form of the tool. I redesigned it a little to make room for the features which include:
This is what the buttons can look like now. First image shows button 1 to be the (system)default, the second image shows the middle button (button 2) to be the (custom) default. In both images you can see the number in brackets (3) and (2) - which are the AutoCloseSeconds remaining before the specific button will be "pressed".
In the upper part of the next image you see the Your Button Code page open, showing the code that can be copied and pasted into your application! A little side note: The code might look ugly in this preview, but looks very nice in your code window! You can see the wizard created code below this image.
Your-Code-Wizard from one of the dialog boxes above - ready to copy&paste! No need to code anything by hand.
'Your-Code-Wizard by https://www.datenbank-projekt.de strResult = Dialog.RichBox(Prompt:= "
You flight BA5584 has already left the runway.
It 's a bit too late to run after it.
Would you like to book another flight?" & "", _ Buttons:=(1024+64), _ Title:="Enhanced Message Box", _ LabelButton1:="Button1", _ LabelButton2:="thisDefault", _ LabelButton3:="Button3", _ DismissID:="", _ AutoCloseSec:=3, _ DefaultButton:=2, _ BGColorButton1:= RGB(200,200,225), _ BGColorButton2:= RGB(100,225,100), _ BGColorButton3:= RGB(225,100,100), _ AllowBeep:=True, _ AllowCopyToClipboard:=True, _ AllowSaveToFile:=True, _ ButtonDelay:=2, _ NoStrEsc:=False)
You can use the ampersand (&) symbol before characters in the button description to enable keyboard access as usual:
Please note, that this first idea may actually not work. I suggest you try the second idea first to get the improved enhanced message box working for non-unicode languages.
To solve: Instead of writing the Urdu (non-unicode) message in VBE, store it in a table and then call related text message when required.
I was notified, that an older version (1.18) did throw an error when the user started the tool. This error looked like this:
It turned out, that actually the VBA editor is not capable of using unicode (in simple words) but the user mentioned, that he is working on a system with regional settings set to Arabic (Saudi-Arabia). We tried and found a/the solution how you can make the software work on your system.
To reproduce, please visit and copy some Urdu (non-unicode) text from e.g. www.urdupoint.com (a website in Urdu language), use it in frmEnhancedMessageTest to generate the code (and view the message box demo) and then use the same code into any button click event on the same form. You will see that demo works fine but click event code message box strange.
To solve, please open the regional settings on your windows using Windows-Key + R to open the execute window. Type intl.cpl and press the Enter-Key. You will see a window where, on the right register (Administrative) you can change some regional settings. Click there the button in the lower part of the window that reads Change system locale. In the following window, check the checkbox that is labeled like Beta: Use Unicode UTF-8 for worldwide language support. Doing this should enable you to use the application (after your system has been restarted).
Please let me know using the contact form.