Custom build dialogs
No more boring standard dialogs - time for custom build dialogs!
Anyone who works with ACCESS knows them all too well: MsgBox and InputBox. Functional? Yes. Modern, appealing or user-friendly? Unfortunately not. These standard dialogs seem - let's say - a bit outdated. And if we're honest: Who actually reads these standard messages carefully anymore? Most people simply click on “OK” without even risking a glance.
But what if we could change that?
In my latest project, I show you three tailor-made dialogs that give ACCESS a real boost of freshness. Why? Because modern users expect more - and because ACCESS deserves it!
The problem: What looks old can't be good. We should change that.
Why your own dialogs?
The standard dialogs cannot do many things:
❌ Display tables
❌ Integrate images
❌ Colored, formatted texts
❌ Embed web pages
❌ Use your own icons
❌ Print dialogs
❌ Select data from a list
And this is exactly where my custom dialogs come in!
The three stars of the show:
- eMsgBox - the modern replacement for MsgBox
- eInputBox - user-friendly input at last
- eComboBox - the extra that Access has been missing until now
The eComboBox is particularly exciting: a kind of InputBox - but with a ComboBox! And best of all: the values can be transferred via a value list or SQL statement. Super flexible!
💡 Nice to know:
The custom notifications that I introduced to you in the last article can be seamlessly integrated. This gives you a consistent, modern UI concept - from the small notification to the interactive dialog!
✨ Highlights at a glance:
✨ Web browser control as a body
HTML in the dialog box - sounds complex, but it's not! Even simple basic knowledge is enough to achieve great results. But you can use as well pure text.
✨ Many customization options
Up to 6 buttons, size can be adjusted, automatic hide after X seconds, print the dialog, Easily add or customize dialog types!
✨ Templates instead of endlessly typing code
The HTML designs are stored as templates in a table - with placeholders that are replaced by content at runtime. Snap - dialog done!
✨ IntelliSense included
All dialogs are structured in such a way that they can be conveniently called up using IntelliSense. No constant searching for options - just get started!
Adapting dialog types
The dialog types are entered as an enumeration in modDLG_Dialogs and in tblDLG_Dialogs. The colors and the icon can be adjusted in the table. If you want to create a new dialog type, you simply have to make another entry in the table and enter the name of the dialog as an enumeration. And that's it!
Some examples?
MessageBox:
myMsgBox "Header", "This ist he body text", dlgType_Info, "OK", "Cancel"
msgBody = "textHead(Header of the body)" & _
"This text in here is HTML." & _
"So it can be much more than only text" & _
"It could be a table, a picture or whatever." & _
"<a href='https://www .xxx.com' target='_blank'><img src=" & img & width='150'></a>"
With msgDialog
.msgBoxTyp = eMsgBox
.msgArt = dlgType_Info
.msgHeader = "INFORMATION”
.msgBody = msgBody
.msgButton1 = "OK"
.msgButton2 = "Cancel"
.msgButton3 = "Another button" ' 6 Buttons possible
.msgButtonPrint = True
.msgSecToClose = 20
.msgBodyHeight = 4000
.msgBodyWidth = 10000
.startMyBox
msgButtonClicked = .msgButtonClicked
End With
With msgDialog
.msgBoxTyp = eMsgBoxTemplate
.msgTemplate = "PDFsavedSuccesfull"
.msgTemplDummy1 = "Your report was saved as PDF succesfull"
.msgTemplDummy2 = "sFilePath"
.startMyBox
End With
InputBox:
var = myInputBox("QUESTION", "Please enter a value.", dlgType_Question, "Default value", "OK")
msgBody = "textHead(Header of the body)" & _
"This text in here is HTML."
With msgDialog
.msgBoxTyp = eInputBox
.msgArt = dlgType_Question
.msgHeader = "QUESTION”
.msgBody = msgBody
.msgButton1 = "OK"
.msgButton2 = "Cancel" ' 3 Buttons possible
.msgDefaultValue = "hello world"
.startMyBox
msgButtonClicked = .msgButtonClicked
msgValue = .msgReturnValue
End With
Like the MessageBox
ComboBox:
Like the InputBox
msgBody = "textHead(Header of the body)" & _
"This text in here is HTML."
With msgDialog
.msgBoxTyp = eComboBox
.msgArt = dlgType_Question
.msgHeader = "QUESTION”
.msgBody = msgBody
.msgButton1 = "OK"
.msgButton2 = "Cancel"
.msgComboValue = "1;2;3;4"
' OR
.msgComboValue = "SELECT dlg_name, dlg_colorBackground FROM tblDLG_Dialogs ORDER BY dlg_name"
.msgComboColumns = "5cm;0cm"
.startMyBox
msgButtonClicked = .msgButtonClicked
msgValue = .msgReturnValue
End With
Like the MessageBox
And now it's your turn!
Let's take ACCESS to the next level together. Because one thing is clear:
Standard was yesterday. Today, ACCESS is sexy. 🔥
This small extension not only makes your Access interface more intuitive, but also a whole lot “sexier”.
You can find the detailed description and all notes directly in the code - well documented as usual.
DOWNLOAD
Version: 1.2
