Can I move the focus to the No button in a Msgbox?

  • Thread starter Thread starter David Anderson
  • Start date Start date
D

David Anderson

A standard Access 2000 Msgbox with Yes and No buttons always opens with the
focus on the Yes button. Is there any way to move the focus to the No
button? I can't see anything about this in the online help, so I'm not very
optimistic....

David
 
David said:
A standard Access 2000 Msgbox with Yes and No buttons always opens with the
focus on the Yes button. Is there any way to move the focus to the No
button? I can't see anything about this in the online help, so I'm not very
optimistic....


Use the Default constants to specify that:

MsgBox " ... ", vbYesNo + vbDefaultButton2, ...
 
Hi Marshall,
Thanks, as always, for your prompt and useful assistance. My Msgbox now
works the way I want. I will have to learn more about these VB constants....

David
 
David Anderson said:
Hi Marshall,
Thanks, as always, for your prompt and useful assistance. My Msgbox now
works the way I want. I will have to learn more about these VB
constants....

Open any code window, go to View >>> Object Browser and type in "constants"
without the quotes into the search window.
 
While you're in the VBE, check Help for the MsgBox function
to see all the constants that can be used with the function.

And, as Arvin pointed out, the Object Browser can be very
handy.
 
I am embarrassed to say that I DID look at the online help before starting
this thread - and never saw the references to vbDefaultButton1,
vbDefaultButton2, etc. I have been putting off an eye test for several
weeks. It now looks likely that I need new glasses (or a new brain).

David
 
Your brain is fine. The online help is difficult to use and may not have
everything you need. That's why both I and Marsh mentioned the Object
Browser. There may not be a complete explanation, but usually, there's
enough to figure out how to proceed.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

David Anderson said:
I am embarrassed to say that I DID look at the online help before starting
this thread - and never saw the references to vbDefaultButton1,
vbDefaultButton2, etc. I have been putting off an eye test for several
weeks. It now looks likely that I need new glasses (or a new brain).

David
 
Back
Top