Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default 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



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default 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





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default 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







  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default 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





Reply
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
Userform SetFocus with Exit and Cancel Neal Excel Programming 3 January 31st 06 01:21 AM
Userform setfocus problem Martin Hibberd[_2_] Excel Programming 1 November 10th 04 12:12 PM
SetFocus Question Sam Excel Programming 2 August 20th 04 04:01 PM
SetFocus to first textbox on userform upon Userform1.Show Paul Simon[_3_] Excel Programming 6 February 11th 04 04:31 PM
UserForm1.Textbox1.SetFocus Question Zane Greer Excel Programming 1 September 14th 03 11:59 AM


All times are GMT +1. The time now is 09:16 AM.

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

About Us

"It's about Microsoft Excel"