Opening a form based on looked up form name.

SeanNij used Ask the Experts™
Hi all, trust you are keeping well!

Using MS Access 2010. I have a table that has particular values associated to a particular tab name.

1 / MainTab
2 / BookingInTab
3 / QuotationTab

I would like to open a form that contains the tab control and then set the focus to the relevant Tab based on a value that is looked up.


The lookup returns a "1" and then i would open the form:
Docmd.Openform "FormWithTabControl"

and then

Forms!FormWithTabControl! ( insert looked up tab name here) . SetFocus

How do get the tab name in the above line?

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Assuming the numbers match the page indexes..

Forms!FormWithTabControl! tabcontrolname.Pages(lookupvalue -1). SetFocus


I can use that to make it work! Fantastic Thankyou

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial