Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / November 2004

Tip: Looking for answers? Try searching our database.

Setting Default Control in User Form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Microsoft - 01 Nov 2004 12:33 GMT
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
Andra - 01 Nov 2004 17:42 GMT
.TabIndex = 0 ?

> Word 2000
>
[quoted text clipped - 5 lines]
>
> --Tom
Montana DOJ Help Desk - 02 Nov 2004 06:25 GMT
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."
> .TabIndex = 0 ?
>
[quoted text clipped - 7 lines]
> >
> > --Tom
Jay Freedman - 01 Nov 2004 20:13 GMT
> Word 2000
>
[quoted text clipped - 6 lines]
>
> --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).

Signature

Regards,
Jay Freedman
Microsoft Word MVP          FAQ: http://word.mvps.org

Montana DOJ Help Desk - 02 Nov 2004 06:26 GMT
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."
> > Word 2000
> >
[quoted text clipped - 19 lines]
> control that has the TabStop property set to True -- labels and some other
> controls default to TabStop = False, so they don't count).
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.