Hello,
How do I create a VBA macro to switch between tabs in a navigation form in Access? I would think the code would be simple, but I haven't been able to find anything clear or definitive online. These are the code samples I've tried so far:
Private Sub Command5_Click()
With Me.TabCtl0 .Value = (.Value + 1) Mod .Pages.Count
End With
End Sub
Private Sub Command1_Click()
Me.NavigationButton2.SetFocus
End Sub
They give me errors, so I wonder if something more complicated is needed. The button and the tabs are separate (button is not on the tab itself), as shown in the attached image. We will eventually want to switch between many tabs, hence why we would like a button.
How do I create a VBA macro to switch between tabs in a navigation form in Access? I would think the code would be simple, but I haven't been able to find anything clear or definitive online. These are the code samples I've tried so far:
Private Sub Command5_Click()
With Me.TabCtl0 .Value = (.Value + 1) Mod .Pages.Count
End With
End Sub
Private Sub Command1_Click()
Me.NavigationButton2.SetFocus
End Sub
They give me errors, so I wonder if something more complicated is needed. The button and the tabs are separate (button is not on the tab itself), as shown in the attached image. We will eventually want to switch between many tabs, hence why we would like a button.