1
votes

I have forms with various sub forms and tab control pages. A combo box is used to navigate the records in the entire form. Whenever the value is changed from the combo box or from the navigation buttons, the first tab control page is always visible. I want to make the current tab control page to be visible whenever the form is refreshed. any help how to do so please?

1

1 Answers

0
votes

Syntax for setting the tab: Me.TabControlName.Pages.Item(PageIndexNumber).SetFocus

Event for form refresh: https://msdn.microsoft.com/en-us/library/office/ff193159.aspx

Short version - put this in your form's code:

Private Sub Form_Current()

Me.TabControlName.Pages.Item(0).SetFocus

End Sub

When the form is refreshed the Form_Current event will fire and execute your code. Since you want the first tab to be visible the Item index is 0. Replace TabControlName with the name of your control.