MsgBox color

  • Thread starter Thread starter Emma
  • Start date Start date
E

Emma

Message boxes in my Access table come up blue in color,
which clashes with the carefully designed color scheme in
all my forms. I've learned to deal with other Access
limitations with color, but this is annoying. I saw
something once (darn if I can find it again) that said
something about system colors. My programme will be used
by many people, so I do not want to permantantly change
their colors. Is there an easy way to set the color of
MsgBox to what I want? If possible, could someone provide
me with the code?

Ever thankful for this forum,
Emma
 
There is no specific resolution to the issue on my site.
I suppose you could try setting the Default Brush for the specific
Dialog Window class, as I do for the MDIBackground color solution but
it's just a guess.
--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
Message boxes in my Access table come up blue in color,
which clashes with the carefully designed color scheme in
all my forms. I've learned to deal with other Access
limitations with color, but this is annoying. I saw
something once (darn if I can find it again) that said
something about system colors. My programme will be used
by many people, so I do not want to permantantly change
their colors. Is there an easy way to set the color of
MsgBox to what I want? If possible, could someone provide
me with the code?

Ever thankful for this forum,
Emma

If you don't want to change the system colors, the best solution would
be for you to simply create your own unbound form and a label to work
as a Message box. Give it whatever color background you want.

Instead of using MsgBox "Some Message" you would use the OpenForms
(as acDialog) method to open the form with a message. The actual
message can be passed to the form using the OpenForm OpenArgs
argument.

DoCmd.OpenForm "frmMessage", , , , , acDialog, "An incorrect entry has
been made"`

Then use the form's Load event to read the OpenArgs and pass it's
value to the label.caption.

If IsNull(Me.OpenArgs) Then
Else
Me!LabelName.Caption = Me.OpenArgs
End If
 
Thank you, PC Datasheet, Stephen, Douglas and Fred! I
knew about creating forms in lieu of message boxes, but
for an application already chock full of forms, I'd
probaby double the number to handle all situations where
an "on-the-fly", simple message box would do the trick.
Still, perhaps I can set my message values where needed
and call a generic form to be populated with the message.
I don't understand Stephen's message about setting brush
colors, but will check out his website. Thanks again.
Emma
 
Back
Top