ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   userform setfocus question (https://www.excelbanter.com/excel-programming/378185-userform-setfocus-question.html)

Gary Keramidas

userform setfocus question
 
is there any way to get the cursor in a certain text box? when i leave a textbox
and the entry isn't valid, i would like to get the cursor back in that textbox.
setfocus only seems to work when the form is activated.

--


Gary




MarMo

userform setfocus question
 
Gary ,
Do you open another userform when leaving the textbox?
If not , your userform will remain active as your controls on this userform.

so , textbox1.setfocus should do the trick when the entry is invalid.

otherwise , post a little of your code , so we can check what's wrong.

MarMo


"Gary Keramidas" <GKeramidasATmsn.com wrote in message
...
is there any way to get the cursor in a certain text box? when i leave a
textbox and the entry isn't valid, i would like to get the cursor back in
that textbox. setfocus only seems to work when the form is activated.

--


Gary






Gary Keramidas

userform setfocus question
 

Private Sub CommandButton2_Click()

Me.TextBox1.Value = ""
Me.TextBox2.Value = ""
Me.TextBox3.Value = ""

Me.TextBox2.SetFocus
End Sub


--


Gary


"MarMo" wrote in message
...
Gary ,
Do you open another userform when leaving the textbox?
If not , your userform will remain active as your controls on this userform.

so , textbox1.setfocus should do the trick when the entry is invalid.

otherwise , post a little of your code , so we can check what's wrong.

MarMo


"Gary Keramidas" <GKeramidasATmsn.com wrote in message
...
is there any way to get the cursor in a certain text box? when i leave a
textbox and the entry isn't valid, i would like to get the cursor back in
that textbox. setfocus only seems to work when the form is activated.

--


Gary








Gary Keramidas

userform setfocus question
 
does anybody know of a way to do this?

--


Gary


"Gary Keramidas" <GKeramidasATmsn.com wrote in message
...
is there any way to get the cursor in a certain text box? when i leave a
textbox and the entry isn't valid, i would like to get the cursor back in that
textbox. setfocus only seems to work when the form is activated.

--


Gary







All times are GMT +1. The time now is 11:27 PM.

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