ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   multipage (https://www.excelbanter.com/excel-programming/402111-multipage.html)

AManso

multipage
 
Hello
I cannot understand why this do not work properly on excel 2003 SP2 and it
works ok on excel 2000, both running on windows bxp

userform1
multipage1, pages 1 to 6
textbox1 in page 1

Private Sub MultiPage1_Change()
If MultiPage1.Value = 1 Then
If TextBox1.Value = Empty Then MultiPage1.Value = 0
TextBox1.SetFocus
End If
End Sub

Any ideas?

Thanks




Bob Phillips

multipage
 
I guess that it is trying to set the focus to a control that is not yet
vis9ible.

You could try this

Private Sub MultiPage1_Change()
If MultiPage1.Value = 1 Then
If TextBox1.Value = Empty Then
Application.OnTime Now(), "MultiPageAction"
End If
End If
End Sub

and in a standard code module add

Sub MultiPageAction()
With UserForm1
.MultiPage1.Value = 0
.TextBox1.SetFocus
End With
End Sub

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"AManso" wrote in message
...
Hello
I cannot understand why this do not work properly on excel 2003 SP2 and it
works ok on excel 2000, both running on windows bxp

userform1
multipage1, pages 1 to 6
textbox1 in page 1

Private Sub MultiPage1_Change()
If MultiPage1.Value = 1 Then
If TextBox1.Value = Empty Then MultiPage1.Value = 0
TextBox1.SetFocus
End If
End Sub

Any ideas?

Thanks






AManso

multipage
 
I am the solution you have suggested do not work. I emphasize the code runs
ok in excel 2000 but nor in excel 2003!!!!

"Bob Phillips" wrote:

I guess that it is trying to set the focus to a control that is not yet
vis9ible.

You could try this

Private Sub MultiPage1_Change()
If MultiPage1.Value = 1 Then
If TextBox1.Value = Empty Then
Application.OnTime Now(), "MultiPageAction"
End If
End If
End Sub

and in a standard code module add

Sub MultiPageAction()
With UserForm1
.MultiPage1.Value = 0
.TextBox1.SetFocus
End With
End Sub

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"AManso" wrote in message
...
Hello
I cannot understand why this do not work properly on excel 2003 SP2 and it
works ok on excel 2000, both running on windows bxp

userform1
multipage1, pages 1 to 6
textbox1 in page 1

Private Sub MultiPage1_Change()
If MultiPage1.Value = 1 Then
If TextBox1.Value = Empty Then MultiPage1.Value = 0
TextBox1.SetFocus
End If
End Sub

Any ideas?

Thanks








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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com