Solved

Format a messagebox

Posted on 2004-03-26
3
2,064 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
ID: 10692451
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
ID: 10698122
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
ID: 10705119
Thanks for the help.  At least now I can tell the user to try something else.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
data analyst 3 50
SQL profiler equivalent in MS-Access 3 43
DBF to ... Converter 5 43
field number type in access tabledefs fields 5 19
When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

920 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

16 Experts available now in Live!

Get 1:1 Help Now