Solved Hi team, I have a Tab control question for my form. (1 Viewer)

Teri Bridges

Member
Local time
Today, 03:00
Joined
Feb 21, 2022
Messages
186
I have one main form "Courses" and within that form I have two sub-forms on tab controls (Pages) "Event" and "Issue Log". Currently, the users can click the tab and move between the two tabs (subforms).

In the Events tab subform there is a check box for Issue (yes/no), I would like to have the check box, when selected, open the tab or page "Issue Log". I am not sure how to do this can someone help?

I need the tab page with the subform to open because it is tied to the Course ID (Auto populates). Opening just the issue subform is not bound to a course record.

Right now the user has to select yes/no if there is an issue and then select the Issue log to enter the issue. If I can get the Issue log tab to automatically open that would be nice.

Yes, I am new to access.
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 04:00
Joined
May 21, 2018
Messages
8,529
To switch pages of a tab control you simply set the value of the tab control. It is 0 based so the first tab is page 0.

To move to the second tab
me.TabControlName = 1
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 04:00
Joined
May 21, 2018
Messages
8,529
When you are designing you may not know what order to put your tabs, so you might not want to hard code a value. You may want to call it by name instead
Me.tabCtlOne.Pages("pgEvent").SetFocus
or
Me.tabCtlOne.Value = Me.tabCtlOne.Pages("pgEvent").PageIndex
 

Teri Bridges

Member
Local time
Today, 03:00
Joined
Feb 21, 2022
Messages
186
To switch pages of a tab control you simply set the value of the tab control. It is 0 based so the first tab is page 0.

To move to the second tab
me.TabControlName = 1
Did not work. I might not have explained myself well. I have a button, when I click the button, I would like the tab that the issue log is on to open.
 

Teri Bridges

Member
Local time
Today, 03:00
Joined
Feb 21, 2022
Messages
186
When you are designing you may not know what order to put your tabs, so you might not want to hard code a value. You may want to call it by name instead
Me.tabCtlOne.Pages("pgEvent").SetFocus
or
Me.tabCtlOne.Value = Me.tabCtlOne.Pages("pgEvent").PageIndex
Did not work. I might not have explained myself well. I have a button, when I click the button, I would like the tab that the issue log is on to open.
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 04:00
Joined
May 21, 2018
Messages
8,529
I would like the tab that the issue log is on to open.
You definitely are not explaining it then. The code I provided switches focus to the selected tab. Can you post what you really wrote? Can you show a screenshot of your form?
 

Teri Bridges

Member
Local time
Today, 03:00
Joined
Feb 21, 2022
Messages
186
You definitely are not explaining it then. The code I provided switches focus to the selected tab. Can you post what you really wrote? Can you show a screenshot of your form?
I am sorry, here is my tab control, if I am understanding correctly
1695073091630.png

Here is the page and subform my button is on, it is a yes/no button
1695073306872.png


Here is the page I would like to open when the check box is selected
1695073382595.png
 

Teri Bridges

Member
Local time
Today, 03:00
Joined
Feb 21, 2022
Messages
186
I have one main form "Courses" and within that form I have two sub-forms on tab controls (Pages) "Event" and "Issue Log". Currently, the users can click the tab and move between the two tabs (subforms).

In the Events tab subform there is a check box for Issue (yes/no), I would like to have the check box, when selected, open the tab or page "Issue Log". I am not sure how to do this can someone help?

I need the tab page with the subform to open because it is tied to the Course ID (Auto populates). Opening just the issue subform is not bound to a course record.

Right now the user has to select yes/no if there is an issue and then select the Issue log to enter the issue. If I can get the Issue log tab to automatically open that would be nice.

Yes, I am new to access.
I was able to get it to work even though I got this error when I first ran the event. It seems to be working and recording my entries.
1695076451936.png
 

Users who are viewing this thread

Top Bottom