M
Martin
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
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