Navigation control and switch between tabs nightmare!!!

Gianluca

Registered User.
Local time
Today, 15:58
Joined
May 21, 2015
Messages
15
Hi, i'm using a navigation control with 3 tabs.
I would like to open a specific tab after the user login.
I tried this but it does not work:
NavigationControlName.Tabs.Item("tabNameToOpen").SetFocus

i have tried:
Me.NavigationSubForm.SourceObject = "FormName"
then the form change but the tab selection no!
 
try this either after the docmd.openform command or the on load event:

YourFormName.YourTabControlName.Value = either 0, 1, or 2 depending on which tab you want opened.
 
So the tab to open would be dependent on the user that logs in? And would the other tabs (or buttons) be visible?
 
I'm not sure what you are trying to do here, but I'm going to guess that you want certain tabs visible to some users and not to others for confidentiality or security reasons. Is that what you are trying to do? If so, how many different levels are we talking about?
 
i tried this in the Form_Load() event:
YourFormName.YourTabControlName.Value = either 0, 1, or 2

but Access return an error: "Runtime Error: '2448': impossible to assign a value to the object."

For hubcap750 user: yes, i can disable a tab with the Enable property but i would like to open a specific tab, when the form open, if a user is belongs to a specific group.
User is in the A group: the form should open on tab 3
User is in the B group: the form should open on tab 2
 
Your first post and title mentions a navigation control, but now you mention a tab control. Which is it?
 
ohhps! yes, is the control that use the tabs.
Sorry but the translation from italian to english is "displacement control".
 
Ok, but are you sure it's not a Navigation Form? Double check.

If it's a Tab Control then this is the syntax:
Code:
Me.[COLOR="Blue"]TabControlName[/COLOR].Pages("[COLOR="blue"]PageName[/COLOR]").SetFocus
 
The PAGES property does not exist!
 

Attachments

  • tabs.JPG
    tabs.JPG
    16.1 KB · Views: 144
  • TabsControl.jpg
    TabsControl.jpg
    25 KB · Views: 154
  • TabControlIcon.JPG
    TabControlIcon.JPG
    19.1 KB · Views: 153
Last edited:
try setting the focus on a control on the tab you want the form to open to.
 
It is a Navigation Form, not a Tab control.

You have two options:
Code:
DoCmd.BrowseTo acBrowseToForm, "[COLOR="Blue"]NavigationTargetName[/COLOR]", "[COLOR="blue"]NameOfForm[/COLOR].[COLOR="blue"]NameOfNavigationSubform[/COLOR]"

Code:
Me.NameOfButton.SetFocus
VBA.SendKeys "{ENTER}"
... either will go in the Open (not the Load) event of the form. And the first one is preferential.
 
NavigationControlName.Tabs.Item("tabNameToOpen").SetFocus

after this line the tab is surrounded by a light outline but the tab does not switch.
 

Attachments

  • before.JPG
    before.JPG
    11.9 KB · Views: 158
  • After.JPG
    After.JPG
    14 KB · Views: 157
NavigationControlName.Tabs.Item("tabNameToOpen").SetFocus

after this line the tab is surrounded by a light outline but the tab does not switch.
I don't think hubcap realises that it's a Navigation Form and you may have missed my last post.
 
You are right vbaInet, I missed your post and didn't know it was a navigation form.
 
Perfect! now it works but let me say: it is not a simple implementation! maybe an ad-hoc method is better.
Thanks
 
Navigation forms are not the best controls to work with.

Which option did you go for?
 

Users who are viewing this thread

Back
Top Bottom