ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   TextBox focus 3 (https://www.excelbanter.com/excel-programming/305426-textbox-focus-3-a.html)

Tim Coddington

TextBox focus 3
 
I have a userform with a textbox on it and several other controlls. I want
only the text box to have focus so the user can repeatedly input a number,
press return to process, and enter the next number. On one form I have,
after the return, focus comes back to the text box like it should. On
another form, it leaves to another control. What could be the difference
between the two forms? I don't see anything in my code that would do that.



Mauro Gamberini[_2_]

TextBox focus 3
 
I have a userform with a textbox on it and several other controlls. I
want
only the text box to have focus so the user can repeatedly input a number,
press return to process, and enter the next number. On one form I have,
after the return, focus comes back to the text box like it should. On
another form, it leaves to another control. What could be the difference
between the two forms? I don't see anything in my code that would do

that.



TextBox Property TabIndex
TextBox Property TabStop

--
----------------------------
Mauro Gamberini



Bob Phillips[_7_]

TextBox focus 3
 
show the code on both.

--
HTH

-------

Bob Phillips
"Tim Coddington" wrote in message
...
I have a userform with a textbox on it and several other controlls. I

want
only the text box to have focus so the user can repeatedly input a number,
press return to process, and enter the next number. On one form I have,
after the return, focus comes back to the text box like it should. On
another form, it leaves to another control. What could be the difference
between the two forms? I don't see anything in my code that would do

that.





Tim Coddington

TextBox focus 3
 
TabIndex, TabStop made no change. There is no tab used.
"Mauro Gamberini" wrote in message
...
I have a userform with a textbox on it and several other controlls. I

want
only the text box to have focus so the user can repeatedly input a

number,
press return to process, and enter the next number. On one form I have,
after the return, focus comes back to the text box like it should. On
another form, it leaves to another control. What could be the

difference
between the two forms? I don't see anything in my code that would do

that.



TextBox Property TabIndex
TextBox Property TabStop

--
----------------------------
Mauro Gamberini





Tim Coddington

TextBox focus 3
 
Just looking at the from that fails, this is all the code. I found nothing
in the other text box's code to help.


Private Sub OptionButton1_Click()
TextBox1.SetFocus
End Sub

Private Sub OptionButton2_Click()
TextBox1.SetFocus
End Sub

"Bob Phillips" wrote in message
...
show the code on both.

--
HTH

-------

Bob Phillips
"Tim Coddington" wrote in message
...
I have a userform with a textbox on it and several other controlls. I

want
only the text box to have focus so the user can repeatedly input a

number,
press return to process, and enter the next number. On one form I have,
after the return, focus comes back to the text box like it should. On
another form, it leaves to another control. What could be the

difference
between the two forms? I don't see anything in my code that would do

that.








All times are GMT +1. The time now is 12:31 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com