Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Function FormattedMsgBox( _
Prompt As String, _
Optional Buttons As VbMsgBoxStyle = vbOKOnly, _
Optional Title As String = vbNullString, _
Optional HelpFile As Variant, _
Optional Context As Variant) _
As VbMsgBoxResult
If IsMissing(HelpFile) Or IsMissing(Context) Then
FormattedMsgBox = Eval("MsgBox(""" & Prompt & _
""", " & Buttons & ", """ & Title & """)")
Else
FormattedMsgBox = Eval("MsgBox(""" & Prompt & _
""", " & Buttons & ", """ & Title & """, """ & _
HelpFile & """, " & Context & ")")
End If
End Function
FormattedMsgBox "Title@1st Msg line@2nd Msg line, vbExclamation,"Custom MsgBox"
You can use the MsgBox action to create a formatted error message similar to built-in error messages displayed by Access. The MsgBox action permits you to supply a message in three sections for the Message argument. You separate the sections with the "@" character.
The following example displays a formatted message box with a sectioned message. The first section of text in the message is displayed as a bold heading. The second section is displayed as plain text beneath that heading. The third section is displayed as plain text beneath the second section, with a blank line between them.
Enter the following in the Message argument:
Wrong button!@This button doesn't work.@Try another.
"Wrong button!" & vbCrLf & "This button doesn't work." & vbCrLf & "Try another."
[blue]edit = FormattedMsgBox("Would you like to EDIT the company [blue][b]@[/b][/blue]" & tmpnewcomp.Value & "?[blue][b]@[/b][/blue]", vbYesNo, "Edit Company")[/blue]
[b]fatal Error 2145[/b]
Can't Continue!
Notify an Admin
Dim Msg As String, NL As String, DL As String
NL = vbnNewLine
DL - NL & NL
Msg = "A Fatal Error Has Occured" & DL & _
"It May Be All Over For You!" & _
"[blue][b]@[/b][/blue]First try the Task Manager . . . ." & NL & _
"Then Slap The Monitor!" & _
"[blue][b]@[/b][/blue]Press OK to try Again . . ." & DL & _
"Press Retry to start over" & DL & _
"Press Cancel to abort. . . ."
MsgBox Msg would look like:
[b]A Fatal Error Has Occured
It May Be All Over For You![/b]
First try the Task Manager . . . .
Then Slap The Monitor!
Press OK to try Again . . .
Press Retry to start over
Press Cancel to abort. . . .
[blue]Public Msg As String, Style As Integer, Title As String
Public Const NL As String = vbNewLine [green]'New Line[/green]
Public Const DL As String = NL & NL [green]'Double Line[/green]
Public Const DQ As String = """" [green] 'Used by EVal[/green][/blue]
[blue]Public Function uMsg() As Integer
Beep
uMsg = Eval("MsgBox(" & DQ & Msg & DQ & "," & Style & "," & DQ & Title & DQ & ")")
End Function[/blue]
Msg = "An Error Has Occured!" & DL & _
"Resources May Be Low!" & _
"[blue][b]@[/b][/blue]Close open applications . . ." & _
"[blue][b]@[/b][/blue]ReBoot if necessary . . ."
Style = vbCritical + vbOKOnly
Title = "UnKnown Error! . . ."
Call [purple][b]uMsg[/b][/purple]