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: 35
Default textbox focus

On a userform (say, Form1), I have a command button Commandbutton1 for adding text to a list List1 on that form. On clicking the button, the following code is executed:

Form2.Textbox1.Text=""
Form2.Textbox1.SetFocus
Form2.Show

where Form2 is a form which contains among others a command button Commandbutton2 whose Click event handler contains the code

Form1.List1.Additem Textbox1.Text
Form2.Hide

Strangely, however, it is unpredictable whether Textbox1 will be ready for input upon clicking Commandbutton1. Mostly it will be the first time the button is clicked, but upon activating Form2 more times, the Textbox will usually have to be clicked before it is ready for input. That is not what I want. What am I missing here?
 
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
TextBox Focus Tom Ogilvy Excel Programming 0 June 3rd 04 05:58 PM
TextBox Focus Tom Ogilvy Excel Programming 0 June 3rd 04 04:55 PM
TextBox focus Tom Ogilvy Excel Programming 0 June 3rd 04 03:17 PM
TextBox Focus John Wilson Excel Programming 6 January 16th 04 09:59 PM
Which textbox have focus? Tom Ogilvy Excel Programming 0 August 27th 03 03:12 PM


All times are GMT +1. The time now is 04:47 AM.

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

About Us

"It's about Microsoft Excel"