userform setfocus question

  • Thread starter Thread starter Gary Keramidas
  • Start date Start date
G

Gary Keramidas

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 ,
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
 
Private Sub CommandButton2_Click()

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

Me.TextBox2.SetFocus
End Sub
 
Back
Top