Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Format a messagebox

Posted on 2004-03-26
3
Medium Priority
?
2,097 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 5

Accepted Solution

by:
Emanon_Consulting earned 500 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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

721 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