Change font size in VBA

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a msgbox which displays a message that I want emphasize. How do I in
VBA bold, underline, change font size, or change font color?

Thanks
 
In your VBA Code type the object name that you want to HIGHLIGHT, then hit a
.. and start typing font and you will see the drop down to change the
attributes. For example. If you have a label named FONTCOLOR to change that
to BOLD your command would be....
FONTCOLOR.FontBold

For italics

FONTCOLOR.Fontitalics.

Hope this helps
 
That's true for controls on a form, Richard, but the question was how to do
it for message boxes.

AFAIK, there's no way (without APIs) to affect the display on the built-in
message boxes.
 
Your right Doug, I was assuming that she would use the form to display her
message. That would be her alternative with out the API, I took that for
granted.
 
Some people think access is everthing that you need. What you need is
basically a public form with popup type window. Having msg_dsc1, msg_dsc2,
msg_dsc3 etc Each representing Diff Criticals or properties. Have the popup
form except open args and open in hide,but don't activate, then load controls
from the parent form then set visible when closed it need then to activiate
the parent form again.

'''''''''''''''''''''''''''''''''''''''''''''
parent form code
docmd.openform("popup" hidden,"parent"
forms!popup.msg_dsc1.fontbold=30
forms!popup.msg_dsc1="testing"
forms!popup.visible="True"
'''''''''''''''''''''''''''''''''''''''''''''''''''''
popup code

onopen;
parent=openargs

onclose;
docmd.close(me)
docmd.openform(parent)

That should get you started. you can refrence any control on the popup form
from the parent form. therebye changing the properties also. you can use
labels if you set the labels caption first. textboxs need to be changed
aropund a bit.
 
Back
Top