I think before I've used a vbOKCancel type message box but had the cancel button as the default button. I can't remember how I did it. Does anyone have an idea?>
When you type in msgbox and it's prompt then intellisense shows choices for vbOKCancel etc. These can be added together as required. Let me know if this helps
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first
'There are 10 kinds of people in the world: those who understand binary, and those who don't.'
1 + 5 is alot different than
1 or 5
I'm not sure what you are trying to say Ladyhawk but I'd go with the +. I suppose you could do a bitwise AND but it is easier just to add them.
I think Ladyhawke is getting at the fact that the various flags are actually bitmasks, and that you ought to get used to treating them as such. With the message box it generally happens not to matter that much because you generally won't ever try to do anything as silly as the following:
MsgBox "Added AbortRetryIgnore to YesNoCancel", vbAbortRetryIgnore + vbYesNoCancel
MsgBox "ORed AbortRetryIgnore with YesNoCancel", vbAbortRetryIgnore Or vbYesNoCancel
But eventually the day will come when you want to set bits in an existing mask for something (e.g. a windows style bits), where doing addition is likely to get you into trouble.
And on a final note: 'AND' will mask out prior bits, so:
MsgBox "oops", vbYesNoCancel And vbCritical
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.