Easy question

shacket

Registered User.
Local time
Today, 15:29
Joined
Dec 19, 2000
Messages
218
Can you stipulate what the buttons say on a message box (instead of just Yes, No, Cancel, etc.)?
 
In the Help Files under MsgBox Function, there is a listing of all constants.

You can, however, design your own messagebox and place any buttons you'd like on it. (With appropriate VBA code behind them !!)

Good Luck !

Michael Abrams
 
Sorry, I am not following. In that help page (which I have looked at before), it lists all of the default options for the buttons.

I am looking to create custom messages on the msgbox buttons. Perhaps a msgbox with one button that says "Press here if you like cheese" and another that says "Press here if you don't like cheese".

I didn't see in there how to do that. When you say "You can, however, design your own messagebox and place any buttons you'd like on it. " - are you talking about creating a pop up form and using it like a message box?

Dave
 
Exactly !!

Set the properties as follows:
Scroll Bars: Neither
Record Selectors: No
Navigation Buttons: No
Dividing lines: No
Auto Resize: Yes
AutoCenter: Yes
PopUp: Yes
Modal: Yes
Control Box: No
MinMax Buttons: No
Close Button: No

Then place a label with whatever you want the message box to say.
Then place command buttons on the form with whatever captions on them.
Place code behind these buttons.

There's a custom messagebox !!

Good Luck!!

Michael Abrams
 
Alright. I have used that in certain instances. I guess I would rather just keep everything in code than have to create a new form each time I want a custom msgbox. But if that's the only way to do it....!

Thanks for your help.

Dave
 
You don't need to create numerous forms for each message box, you could change the label dynamically and run if statements behind the buttons testing the caption and taking appropriate action.

Ian
 
Hadn't thought of that. Thanks. That's a good idea.
 

Users who are viewing this thread

Back
Top Bottom