textbox focus

G

Guest

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?
 
G

Guest

Wait, it may have something to do with Userform library versions. I will investigate that first.
 

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