ApolloShine
New Member
- Joined
- Jun 23, 2015
- Messages
- 8
Still new with VBA, using only what i have learned online and on these forums lol.
I have created a multipage userform in excel.
i entered a code to set focus on blank text before moving on to the next page when clicking "next" however i keep getting Run-time error '2110'
"Cant move focus to the control because it is invisible, not enabled, or of a type that does not accept the focus".
i think it may be because it is still moving on to page 2 instead of keeping the blank textbox active.
the code i am using is
Private Sub nextbtn_Click()
With MultiPage1
.Value = (.Value + 1) Mod (.Pages.Count)
End With
If Not IsDate(Me.calldate.Value) Then
MsgBox "The date box must contain date"
Me.calldate.SetFocus
Exit Sub
End If
Thanks for all the help
I have created a multipage userform in excel.
i entered a code to set focus on blank text before moving on to the next page when clicking "next" however i keep getting Run-time error '2110'
"Cant move focus to the control because it is invisible, not enabled, or of a type that does not accept the focus".
i think it may be because it is still moving on to page 2 instead of keeping the blank textbox active.
the code i am using is
Private Sub nextbtn_Click()
With MultiPage1
.Value = (.Value + 1) Mod (.Pages.Count)
End With
If Not IsDate(Me.calldate.Value) Then
MsgBox "The date box must contain date"
Me.calldate.SetFocus
Exit Sub
End If
Thanks for all the help