Go to tab page from switchboard manager

J

jhicsupt

Is there a way to go to a particular page on a form from the Switchboard
Manager? I have a form with 5 tab pages. There is a tab page entitled
"Reports". The form name is "Main Input".

I would like a way to press - let's say button 4 - and then go directly to
"Reports" on the "Main Input" page.

Thanks for any help I can get.
 
M

Maurice

It depends on which version you are using. Office 2007 uses embedded macro's
for the switchboard. Within the embedded macro it is difficult.

In office 2003 the switchboard creates VBA code but is has it's own
settings. Often it's simpler to create your own switchboard. This can be a
regular form on which you place the various buttons. You can use the button
wizard to create the various open and close settings.

In this instance you could think of the following situation:

button 1:

private sub OpenReports()
DoCmd.Openform "Reports"
forms!Reports!tabcontrol.pages(4).setfocus
end sub

explanation: the tabcontrol has a name. You should replace this with your
own name which you gave the tabcontrol. the (4) is the index from the page
used in the tabcontrol. If you have 3 tabs you can check the index by looking
at the properties of the tabpage. Refer to this number. If you don't like
referencing numbers you can also use the name of the tabpage but that has to
be between double quotes like "reportspage".
Setfocus makes sure that this page will gets the focus when opening the form.

hope this gives you an indication of what you might be looking for. Need
more help just let us know...
 
J

jhicsupt

Thank you. This worked.

Maurice said:
It depends on which version you are using. Office 2007 uses embedded macro's
for the switchboard. Within the embedded macro it is difficult.

In office 2003 the switchboard creates VBA code but is has it's own
settings. Often it's simpler to create your own switchboard. This can be a
regular form on which you place the various buttons. You can use the button
wizard to create the various open and close settings.

In this instance you could think of the following situation:

button 1:

private sub OpenReports()
DoCmd.Openform "Reports"
forms!Reports!tabcontrol.pages(4).setfocus
end sub

explanation: the tabcontrol has a name. You should replace this with your
own name which you gave the tabcontrol. the (4) is the index from the page
used in the tabcontrol. If you have 3 tabs you can check the index by looking
at the properties of the tabpage. Refer to this number. If you don't like
referencing numbers you can also use the name of the tabpage but that has to
be between double quotes like "reportspage".
Setfocus makes sure that this page will gets the focus when opening the form.

hope this gives you an indication of what you might be looking for. Need
more help just let us know...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top