Solved

Format a messagebox

Posted on 2004-03-26
3
2,059 Views
Last Modified: 2010-05-18
How do I change the format of the text of my messagebox?  Can I change the font size and make it bold?  What does the code look like to do this?
Thanks.
0
Comment
Question by:pmcelhany
3 Comments
 
LVL 5

Accepted Solution

by:
Emanon_Consulting earned 125 total points
Comment Utility
Hi pmcelhany,

It is my understanding that you can not format the size or bold the font in a messagebox.  You can format dates, times, numbers, to display "mmm dd, yyyy" or "##,##0.00" etc.  You can only format the text to be Upper/Lower case using...

MyStr = Format("HELLO", "<")    ' Returns "hello".
MyStr = Format("This is it", ">")    ' Returns "THIS IS IT".
message box example
MsgBox Format("You must select a Date first", ">"), vbInformation, "Report Criteria Missing"
This would be silly of course because you would just type the message all in caps instead of formatting it.

However...
If you create your own msgbox using a form then you have complete control over size, bold, color, etc.  But I believe this is the only way.
If you know what the message box is going to read and you want it custom formatted, then make your own in a form.  You can give it 'Pop Up' and 'Modal' formats as well which will force the User to respond to your message box before being able to continue.

Hope that helps...
Cheers
M
0
 
LVL 65

Expert Comment

by:rockiroads
Comment Utility
The approach to take is what Emanon_Consulting has said

you will have to create your own form if you want to format text within a textbox

as with any form, you can pass it with arguments so that you can have different text appearing each time you call it.
If you do that, it would be better to create a module say MyMessageBox which takes in a string (plus other parameters if you wish to), this module would then call the form. If later on you decide to change this, you simply need to modify thje module MyMessageBox

the only tailoring you can do with a message box is the buttons, you can add in optional graphics with a choice of buttons
0
 

Author Comment

by:pmcelhany
Comment Utility
Thanks for the help.  At least now I can tell the user to try something else.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

5 Experts available now in Live!

Get 1:1 Help Now