background colour of messagebox

Happy YN

Registered User.
Local time
Today, 14:16
Joined
Jan 27, 2002
Messages
425
How do I set a background colour of a msgbox to match the colour of a form
how do you set properties for a msgbox at all e.g. font etc
thanks
 
The simple answer is that you can't but you can create a form that looks like the message box and pop that up instead. Then you can do any colors or fonts you like.

hth,
Jack
 
How d'you know you can't
My experience with access is that there is not much you can't do!
forms are space taking and take time to design etc!
So I am still searching for a reply until I am proven wrong!
Thanks
Happy YN
 
Set the form-detail back color to -2147483633
This will then set your form to the default windows setting (The same color as your msgbox)

To get a real feel for how your forms look try changing the Windows Display property 3D objects to a different color.
(Right click on the desktop, select properties, appearance the 3D Objects from the Item Menu)
You might get a shock how bad your forms will look if installed on a PC with different setting.:)
Dave
 
After reading your post again, The msgbox font is also controlled from the windows display properties as above.
HTH
Dave
 
Why dismiss the advice given by a expert with years of programming experience. As pointed out Windows controls the built in message box, yes it can be changed from within Access with a lengthy API function, however since you want to change it for each form in your db, the results would be unpredictable to say the least.
You only need ONE unbound form with an unbound label or textbox to do what you want, you can change or set whatever you want on that form from the calling form
 
OK Ok please don't get heavy with me. Truth is I was curious to know where the messagebox got its properties from but obviously if I leave it to the users default settings the result is unpredictable.
But Rich I know I could use one form etc. but I need buttons on that form with different reactions depending on what I want to do so where do I put all the code for it in the button of the calling form? How do I do this? Could I trouble you for a small sample?
Thank you
Happy YN
 
Try looking at the help for "Balloons" - they are quite versatile and you can do just about anything with them - have a play !

Gary
 
You can simply reuse the message form by creating the buttons you will need for it and then coding the On-Click event to perform different functions based on a hidden text field. When you call the message form, you will need to specify the information you need. For example, let's say you need a message box with a button to close the message form after the user reads it ( a simple Close button). The button's name is cmdButton1.

In the form calling the message box, you would first code it to open the message form and then:

With forms!MESSAGEFORMNAME

.cmdButton1.caption = "Close"
.HIDDENTEXTBOX = "Close"

End With

Then under the code for the Close Button, you would use a Select Case statement to tell it what to do.

Select Case HIDDENTEXTBOX
Case "Close"
docmd.close
exit sub
Case "Something Else"
do something else
End Select

This way, the button will perform different tasks depending upon the value that you set the hidden text box to .

HTH
 
Rakier,

That's a pretty cool idea! Must try that someday!
:D
 

Users who are viewing this thread

Back
Top Bottom