Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 142
Default How to activate a text box

I have a form that contains a text box and some other controls. After a
user uses one of the other controls, I would like to activate the text box
so that the user can immediately type in it without clicking it first.

Thanks for any help!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 220
Default How to activate a text box

It depends on the control. For an option button:

Private Sub OptionButton1_Click()
Me.TextBox1.SetFocus
End Sub

Or for another textbox:

Private Sub TextBox1_Change()
If Len(Me.TextBox1.Text) = 4 Then
Me.TextBox2.SetFocus
End If
End Sub

--
Dan
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 142
Default How to activate a text box

Thanks - that works great!

On Thu, 15 Nov 2007 08:15:21 -0800 (PST), "Dan R."
wrote:

It depends on the control. For an option button:

Private Sub OptionButton1_Click()
Me.TextBox1.SetFocus
End Sub

Or for another textbox:

Private Sub TextBox1_Change()
If Len(Me.TextBox1.Text) = 4 Then
Me.TextBox2.SetFocus
End If
End Sub


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
Can't activate an add-ins Ivan Setting up and Configuration of Excel 0 June 5th 08 09:33 AM
Windows().Activate vs Workbooks().Activate Gary''s Student Excel Programming 4 November 6th 06 02:01 PM
Workbook.Activate / Window.Activate problem Tim[_44_] Excel Programming 3 February 3rd 06 11:38 PM
adding text path via macro to activate hyperlink Carole Excel Programming 1 September 3rd 03 01:30 AM
Activate Column after locating text in a row Smythe32 Excel Programming 1 July 17th 03 05:32 PM


All times are GMT +1. The time now is 06:02 PM.

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"