I have a user form that has several tab pages on it when the form opens it checks to see if the user has entered there default info if it is empty it needs to go to the default tab so the user can enter there info.
How do I do this using vba in excel 2000 I have not been able to find any code that will do this if I use the set focus option for a text box on the tab page it comes up with an error saying the item is not visible!
The user forme is names = UserDataInputForm
The tab pages I have are
1st = InputDailyTimesPage
2nd = OverTimePage
3rd = DataPage
4th = DefultDataPage
the form opens using the 1st tab page by default
in the user forms inisilisation code I have this check
'User name
If WsConst.Cells(4, 8).Value > 0 Then
'Retreve employee data
Me.EmployeeNameBox = WsConst.Cells(4, 8).Value
Else
MsgBox "Please enter Your Full Name"
Me.EmployeeNameBox.Locked = False
Me.EmployeeNameBox.TabStop = True
Me.EmployeeNobox.Locked = False
Me.EmployeeNobox.TabStop = True
Me.EmployeeNameBox.SetFocus
Exit Sub
End If
But is the “Me.EmployeeNameBox.SetFocus” that’s not working
How can I switch the focus to the “DefultDataPage”
How do I do this using vba in excel 2000 I have not been able to find any code that will do this if I use the set focus option for a text box on the tab page it comes up with an error saying the item is not visible!
The user forme is names = UserDataInputForm
The tab pages I have are
1st = InputDailyTimesPage
2nd = OverTimePage
3rd = DataPage
4th = DefultDataPage
the form opens using the 1st tab page by default
in the user forms inisilisation code I have this check
'User name
If WsConst.Cells(4, 8).Value > 0 Then
'Retreve employee data
Me.EmployeeNameBox = WsConst.Cells(4, 8).Value
Else
MsgBox "Please enter Your Full Name"
Me.EmployeeNameBox.Locked = False
Me.EmployeeNameBox.TabStop = True
Me.EmployeeNobox.Locked = False
Me.EmployeeNobox.TabStop = True
Me.EmployeeNameBox.SetFocus
Exit Sub
End If
But is the “Me.EmployeeNameBox.SetFocus” that’s not working
How can I switch the focus to the “DefultDataPage”