Setting Default Control in User Form

M

Microsoft

Word 2000

How would I set the default button in a user form? If I wanted the user
form to default to a text box when it is displayed, how would I do that?

I've been looking through the online Help and the control properties, but
I'm just not seeing it.

--Tom
 
J

Jay Freedman

Microsoft said:
Word 2000

How would I set the default button in a user form? If I wanted the
user form to default to a text box when it is displayed, how would I
do that?

I've been looking through the online Help and the control properties,
but I'm just not seeing it.

--Tom

Hi Tom,

When you're "drawing" the userform and its controls at design time, select
the button, go to the Properties pane, and change the Default value to True.
The effect is that pressing the Enter key is the same as clicking that
button. There's also a Cancel property so you can make another button
respond to the Esc key.

To select a particular text box when the userform displays, set the TabIndex
property for that box to 0 (more exactly, to the smallest value for any
control that has the TabStop property set to True -- labels and some other
controls default to TabStop = False, so they don't count).
 
M

Montana DOJ Help Desk

Thanks for the reply. I knew there was a way to do this. In fact, I'd done
it before, but could for the life of me remember how!

-- Tom

State of Montana
Department of Justice Help Desk

"Making the world a safer place."
 
M

Montana DOJ Help Desk

Jay,

Thanks for the reply! I have the text box set to be the default control,
and I set Default = True for one button, and Cancel = True for another. It
works perfectly now.

-- Tom

State of Montana
Department of Justice Help Desk

"Making the world a safer place."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top