Reputation: 1995
I have a form which contains subforms organised by tabs. What I want to do is after updating a field while entering a new record, to redirect the user to a tab within the form.
This is may existing code.
Private Sub FIELD1_AfterUpdate()
If Me.FIELD1.Value = "Yes" Then
Me.Parent.TabCtl50.Value = 4
End If
End Sub
It gives the error "Application-defined or object-defined error"
Any ideas?
Upvotes: 1
Views: 434
Reputation: 91376
You can refer to the pages property:
Me.Parent.TabCtl50.Pages(4).SetFocus
Me.Parent.TabCtl50.Pages("PageNameHere").SetFocus
Upvotes: 1