Open tab on a form (1 Viewer)

WILYWAYNE11

New member
Local time
Today, 10:42
Joined
Aug 27, 2022
Messages
20
I have a form with several tabs. I would like to create a short cut macro to open a specific tab. Can this be done????
 

moke123

AWF VIP
Local time
Today, 13:42
Joined
Jan 11, 2013
Messages
3,920
Assuming your talking about a tab control,Yes. Set focus to the page or a control on the tab in question.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 12:42
Joined
Feb 28, 2001
Messages
27,188
Here is an article on tab controls.


In it you would find that the tab control is actually a collection of tab pages. You place controls on a tab page. The tab control itself actually has a value which is the index to the current page. It is possible to read or update the tab control's value. Since the pages on the tab control are typical of Access collections, the first page in the tab control is page 0. You just set the tab control's value to the index of the page you want.

Note that setting the focus on a control that is on a particular tab page kills two birds with one stone, so to speak, since just changing the tab control's value might leave you with an suddenly no longer visible control having focus. Using the control.SetFocus method prevents that.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 01:42
Joined
May 7, 2009
Messages
19,245
see this demo and see the macro of the button
 

Attachments

  • OpenSpecificTab.accdb
    448 KB · Views: 106

Users who are viewing this thread

Top Bottom