How to select Tabs of TabPanel Control using Menu Item

I am trying to select tabs on tabpanel control by clicking on menu items. My tabpanel control name is NavTabs and when I write code to change the value, NavTabs.Value=2, in the menu item click even code it says “This item does not exist” and the word “NavTabs” is highlighted. But if I change the the control name to the default name i.e. TabPanel and change the code to TabPanel.Value=2 then again compiler error says “This item does not exist” but this time the word “Value” is highlighted. I don’t know what’s going on.

Can anyone help me please. I am getting really frustrated.

[quote=116436:@Muhammad Sherazi]I am trying to select tabs on tabpanel control by clicking on menu items. My tabpanel control name is NavTabs and when I write code to change the value, NavTabs.Value=2, in the menu item click even code it says “This item does not exist” and the word “NavTabs” is highlighted. But if I change the the control name to the default name i.e. TabPanel and change the code to TabPanel.Value=2 then again compiler error says “This item does not exist” but this time the word “Value” is highlighted. I don’t know what’s going on.

Can anyone help me please. I am getting really frustrated.[/quote]

If your menu handler is not on the same window as your TabPanel (for instance if it is in App), you need to prefix the name of your tab panel with the name of the window.

Window1.TabPanel1.Value = 2

Thanks Michel !!! You saved my day. I am newly migrating from MS Visual Studio to XoJo Studio. Just having little bumps on my way. But with the help of nice people like you on this forum I am pretty sure I am gonna make it. Thanks once again for such a quick reply with working solution. I just used the prefix and It’s working now.