View Full Version : Tab Controls and Switchboard


Romulus
01-16-2002, 12:21 PM
I have two problems related to Tab Controls and Switchboards.

1) When I open up a form with tab controls from the switchboard, I am not at the top of the page (i.e., I cannot see the tabs). What can I do to see the true "top of the page" when I open up a form?

2) From the switchboard, I would like to be able to click on a button and open up a specific tabbed page on a tab control. Is this possible? I hope I am being clear enough.

naygl
01-16-2002, 05:04 PM
Don't know about you first problem but you can use SetFocus for problem 2.
e.g.
On Open (form with tab control)
Me.PageName.SetFocus
(PageName being the name of the page on your tab control)
It can be done from the switchboard as well (On Click)


[This message has been edited by naygl (edited 01-16-2002).]

Romulus
01-22-2002, 12:54 PM
The problem with that is that I have layered switchboards. When I look at the switchboard in design mode and go to the on click event, it already has the following in there "=HandleButtonClick(2)". In any case, when I replace it with the setfocus, it messes up the button that is on a different switchboard but in the same location. I am still stuck.

naygl
01-22-2002, 03:18 PM
Have you tried using a macro? Choose OpenForm as the first action, type in the form name in the action arguments. In the next row choose GoToControl and type in whatever the page is called.

You have to put DoCmd.RunMacro "MacroName" in the code builder in the OnClick event. I have no idea what =HandleButtonClick(2) is for so my advice is probably useless. Apologies in advance.

Just been looking in help. there is an action in macros called GoToPage.

[This message has been edited by naygl (edited 01-22-2002).]

Pat Hartman
01-22-2002, 04:58 PM
1) When the form is opened in form view (not design view), select the Window/size to fit option from the menu. Then save the form. If this does not fix the problem, you may need to decrease the size of the subform on the first tab.

2) The code to implement naygl's suggestion goes in the form being opened NOT in the switchboard form. As you have seen, EVERY change you make to the switchboard form will affect ALL switchboards so be careful what you do.

Romulus
01-28-2002, 11:53 AM
Thanks for the suggestions. I resolved both problems! Instead of putting the DoCmd. in the OnClick event, I used Switchboard manager and chose the option to run macro when that particular button is clicked. The GoTo Control was what I needed.