Hi,
I'm Sneha and I'd be happy to help you out with your question. Sorry for the inconvenience caused.
To ensure that the related vertical tabs are displayed when setting the focus to the first enabled horizontal tab in your navigation form, you can use the SetSelectedTab method of the navigation control. Please follow the modified code below:
Private Sub Form\_Load()
' Check if x1 is equal to 0
If x1 = 0 Then
' Disable NavigationButton1
NavigationButton1.Enabled = False
Else
' Enable NavigationButton1 and show its related vertical tabs
NavigationControl.SetSelectedTab NavigationButton1
End If
' Check if x2 is equal to 0
If x2 = 0 Then
' Disable NavigationButton2
NavigationButton2.Enabled = False
End If
End Sub
In the code above, make sure to replace NavigationControl with the actual name of your navigation control. Also, ensure that the variables x1 and x2 are properly initialized and contain the appropriate values based on your specific requirements.
By using the SetSelectedTab method with NavigationControl.SetSelectedTab NavigationButton1, you are setting the focus to the first enabled horizontal tab (NavigationButton1) and ensuring that its related vertical tabs are displayed accordingly.
For more Information, please refer to following resources :-
- Access 2010 - Navigation Page, cannot set focus to "inside" form - https://answers.microsoft.com/thread/7c63bdb6-125c-4394-8552-281c8966f0c9
- NavigationButton.SetFocus method (Access) - https://learn.microsoft.com/office/vba/api/access.navigationbutton.setfocus
If you have any other questions or need assistance with anything, please don't hesitate to let me know. It will be my pleasure to Assist you.
Best Regards, Sneha
Give back to the community. Help the next person with this problem by indicating whether this answer solved your problem. Click Yes or No at the bottom.