LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 336
Default setfocus in textbox on multipage

Userform1 has a multipage with two pages.

Page1 has 8 textboxes - Text1 through Text8 and 3 comboboxes

I would like Text1 to receive focus so data can be entered. My code worked
fine on a regular userform but when I changed to a multipage Text1 does not
receive focus - I am stumped. Appreciate any help.
here is code to load
Sub show_myform()
Worksheets("Constants").Range("mysounds").Value = 2
UserForm1.ComboBox1.AddItem "Hourly"
UserForm1.ComboBox1.AddItem "Milage"
UserForm1.ComboBox1.ListIndex = 0
UserForm1.ComboBox2.AddItem "On"
UserForm1.ComboBox2.AddItem "Off"
UserForm1.ComboBox2.ListIndex = 1
Load UserForm1

On Error Resume Next
UserForm1.Show vbModeless
'UserForm1.ComboBox2.ListIndex = 1

With UserForm1.Text1
.SetFocus
.SelStart = 0
.SelLength = Len(.Text)
Cancel = True
End With

End Sub

--
Martin
 
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
setfocus on multipage tab form gives error message Cheryl Excel Programming 3 July 28th 04 03:07 PM
SetFocus to first textbox on userform upon Userform1.Show Paul Simon[_3_] Excel Programming 6 February 11th 04 04:31 PM
TextBox SetFocus Problem Tom Ogilvy Excel Programming 1 September 12th 03 01:27 PM
TextBox.SetFocus steve Excel Programming 4 July 16th 03 07:40 PM


All times are GMT +1. The time now is 03:08 AM.

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

About Us

"It's about Microsoft Excel"