LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default SetFocus to first textbox on userform upon Userform1.Show

I have Userform1 containing several textboxes. When I first open the Excel file and open the Userform for the first time, the cursor correctly appears in the first textbox (Textbox1). However, if I exit the Userform and then go back in, the cursor appears in another Textbox instead of Textbox1. In fact, each time I exit the Userform and go back in, the cursor is in a different Textbox. (The TabIndex of Textbox1 is set to 0.

I've seen answers to several posts here giving a solution of Userform1.Textbox1.SetFocus. I've put that line in the Private Sub UserForm_Initialize() code, but it has not affect

What code can I use so that whenever I open (show) Userform1, the cursor is always in Textbox1, and where do I place such code

Many thanks
Pau


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel VB - show userform1 (at same time) minimized application win Dr.CIMS Excel Discussion (Misc queries) 1 September 13th 07 02:14 AM
UserForm1.Textbox1.SetFocus Question Zane Greer Excel Programming 1 September 14th 03 11:59 AM
TextBox SetFocus Problem Tom Ogilvy Excel Programming 1 September 12th 03 01:27 PM
UserForm TextBox to ActiveSheet TextBox over 256 characters Dan E[_2_] Excel Programming 1 July 28th 03 07:36 PM
TextBox.SetFocus steve Excel Programming 4 July 16th 03 07:40 PM


All times are GMT +1. The time now is 06:53 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"