I found this example in
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
MsgBox with paragraphs
Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » MsgBox with paragraphs
- This topic has 12 replies, 5 voices, and was last updated 22 years, 11 months ago.
Viewing 2 reply threadsAuthorReplies-
WScharlotte
AskWoody LoungerApril 28, 2001 at 2:55 am #524489Sorry, Rupert, but that functionality was removed from VBA 6/Office 2000. Now you have to concatenate a vbCrLf to the string to get the paragraph breaks and there’s no way I know of to make part of the text bold. If you include the @ in a messagebox string, it is interpreted as a literal in this version.
The continuation character is actually a space + an underscore. If you use it in the middle of a concatenated string, you have to include an ampersand either before the continuation character(s) or after them at the start of the next line. If you use the continuation within a function and between arguments, you don’t need a concatenation character. Does that help?
-
WSSteveH
AskWoody LoungerMay 5, 2001 at 4:43 am #524590In Access 97, you could create a messagebox with paragraph breaks in the text and with a portion of the message in bold by using the @ symbol in the prompt. In Access 2000, the @ is interpreted as a literal part of the string, so you can’t create a formatted messagebox using the built-in function.
There is a post on http://www.mvps.org/access/bugs/bugs0035.htm regarding this.
I could not get it to work so I produced the following which does:Public Function FormattedMsgBox( _ Prompt1 As String, Prompt2 As String, Prompt3 As String, _ Optional Buttons As VbMsgBoxStyle = vbOKOnly, _ Optional Title As String = vbNullString, _ Optional HelpFile As Variant, _ Optional Context As Variant) _ As VbMsgBoxResult On Error Resume Next If IsMissing(HelpFile) Or IsMissing(Context) Then FormattedMsgBox = Eval("MsgBox(""" & Prompt1 & "@" & _ Prompt2 & "@" & Prompt3 & """, " & _ Buttons & ", """ & Title & """)") Else FormattedMsgBox = Eval("MsgBox(""" & Prompt1 & "@" & _ Prompt2 & "@" & Prompt3 & """, " & _ Buttons & ", """ & Title & """, """ & _ HelpFile & """, " & Context & ")") End If End Function
The code
Msg = FormattedMsgBox("The authority for the use of " _ & "this System has been removed or is incorrect", _ "Check that your computer's system date is " _ & "correct or seek technical help", _ "Courses Database cannot be opened", 16, _ "Courses Database")
produces the attached formatted Message box.
You can create blank lines by passing in an empty string as one of the Prompt arguments.
HTH -
WSRupert
AskWoody Lounger -
WSSteveH
AskWoody LoungerMay 5, 2001 at 3:15 pm #524684Hi Rupert,
Just Dim Msg at the start of your procedure should do it.Sub TestMessage() Dim Msg Msg = FormattedMsgBox("The authority for the use of " _ & "this System has been removed or is incorrect", _ "Check that your computer's system date is correct " _ & "or seek technical help", _ "Courses Database cannot be opened", 16, "Courses Database") End Sub
HTH
-
WSRupert
AskWoody Lounger -
WSRupert
AskWoody Lounger -
WScharlotte
AskWoody Lounger -
WSRupert
AskWoody Lounger -
WSnmilmine
AskWoody Lounger -
WSchico
AskWoody LoungerJuly 9, 2002 at 6:27 pm #600066I noticed the problem (bug) in Access97 SR2. It works great for returning an email address. If you want the carriage returns, you could try this:
If Eval(“MsgBox(‘You have just deleted the current record.” & chr(13) & “Click “”OK”” to confirm your delete or “”Cancel”” to undo your deletion.” & chr(13) & chr(13)‘,1, ‘Test Message Box’)”) = vbOK Then
‘Do somthing here
End IfThat format worked for me when getting an email address from a text box and displaying it in the message part of the message box with other text and line breaks.
-
-
-
-
-
WScharlotte
AskWoody Lounger -
WScharlotte
AskWoody Lounger
Viewing 2 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Lost sound after the upgrade to 24H2?
by
Susan Bradley
54 minutes ago -
How to move 10GB of data in C:\ProgramData\Package Cache ?
by
Alex5723
1 hour, 50 minutes ago -
Plugged in 24-7
by
CWBillow
9 hours, 11 minutes ago -
Netflix, Apple, BofA websites hijacked with fake help-desk numbers
by
Nibbled To Death By Ducks
14 hours, 3 minutes ago -
Have Copilot there but not taking over the screen in Word
by
CWBillow
11 hours, 12 minutes ago -
Windows 11 blocks Chrome 137.0.7151.68, 137.0.7151.69
by
Alex5723
2 days, 5 hours ago -
Are Macs immune?
by
Susan Bradley
3 hours, 15 minutes ago -
HP Envy and the Function keys
by
CWBillow
1 day, 12 hours ago -
Microsoft : Removal of unwanted drivers from Windows Update
by
Alex5723
2 days, 16 hours ago -
MacOS 26 beta 1 dropped support for Firewire 400/800
by
Alex5723
2 days, 16 hours ago -
Unable to update to version 22h2
by
04om
58 minutes ago -
Windows 11 Insider Preview Build 26100.4482 (24H2) released to Release Preview
by
joep517
3 days ago -
Windows 11 Insider Preview build 27881 released to Canary
by
joep517
3 days ago -
Very Quarrelsome Taskbar!
by
CWBillow
2 days, 10 hours ago -
Move OneNote Notebook OFF OneDrive and make it local
by
CWBillow
3 days, 13 hours ago -
Microsoft 365 to block file access via legacy auth protocols by default
by
Alex5723
3 days, 1 hour ago -
Is your battery draining?
by
Susan Bradley
1 hour, 35 minutes ago -
The 16-billion-record data breach that no one’s ever heard of
by
Alex5723
1 hour, 36 minutes ago -
Weasel Words Rule Too Many Data Breach Notifications
by
Nibbled To Death By Ducks
3 days, 17 hours ago -
Windows Command Prompt and Powershell will not open as Administrator
by
Gordski
1 day, 3 hours ago -
Intel Management Engine (Intel ME) Security Issue
by
PL1
3 days, 1 hour ago -
Old Geek Forced to Update. Buy a Win 11 PC? Yikes! How do I cope?
by
RonE22
2 days, 18 hours ago -
National scam day
by
Susan Bradley
2 days ago -
macOS Tahoe 26 the end of the road for Intel Macs, OCLP, Hackintosh
by
Alex5723
2 days, 21 hours ago -
Cyberattack on some Washington Post journalists’ email accounts
by
Bob99
4 days, 18 hours ago -
Tools to support internet discussions
by
Kathy Stevens
3 days, 6 hours ago -
How get Group Policy to allow specific Driver to download?
by
Tex265
4 days, 9 hours ago -
AI is good sometimes
by
Susan Bradley
5 days, 1 hour ago -
Mozilla quietly tests Perplexity AI as a New Firefox Search Option
by
Alex5723
4 days, 15 hours ago -
Perplexity Pro free for 12 mos for Samsung Galaxy phones
by
Patricia Grace
6 days, 1 hour ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.