Move from one Tab control page to another

A

Ann

I am trying to move from an option group with 5 options (Option 1 through 5)
in a frame (FrameOne) on a subform (subfrmOne) that is on the first page of
a tab control (TabCtlOne) to another option group with 5 options (Option 1
through 5) in a frame (FrameTwo) on a subform (subfrmTwo) on the second page
of the tab control (TabCtlOne) with no luck. I would really appreciate any
help I can get on this? Thanks.
 
O

Ofer Cohen

Set the focus to one of the fields in the second Tab.
If the code run from the main form

Me.[FieldName In second TAB].SetFocus

If the code run from the sub form in TAB1
Me.Parent.[FieldName In second TAB].SetFocus
 
A

Ann

I am trying to go from Page One of the tab control to Page Two of the tab
control so I used the code you specified below:
Me.Parent.[FieldName In second TAB].SetFocus

and received the error listed below:

Run-time error 2465
Microsoft can't find the field "|" I refered to in my expression.

Also, I wasn't sure what event to put this on since I'm using an option
group. I tried it on the "On Exit" event of the Frame I am trying to move
away from.


Ofer Cohen said:
Set the focus to one of the fields in the second Tab.
If the code run from the main form

Me.[FieldName In second TAB].SetFocus

If the code run from the sub form in TAB1
Me.Parent.[FieldName In second TAB].SetFocus

--
Good Luck
BS"D


Ann said:
I am trying to move from an option group with 5 options (Option 1 through 5)
in a frame (FrameOne) on a subform (subfrmOne) that is on the first page of
a tab control (TabCtlOne) to another option group with 5 options (Option 1
through 5) in a frame (FrameTwo) on a subform (subfrmTwo) on the second page
of the tab control (TabCtlOne) with no luck. I would really appreciate any
help I can get on this? Thanks.
 
A

Ann

I got it to work by using:

Me.Parent.TabCtl19.Pages(1).SetFocus

On the "After Update" event of the frame and as long as my Tab Order had the
correct field first it landed where I wanted it to be. Thank you for your
help.

Ofer Cohen said:
Set the focus to one of the fields in the second Tab.
If the code run from the main form

Me.[FieldName In second TAB].SetFocus

If the code run from the sub form in TAB1
Me.Parent.[FieldName In second TAB].SetFocus

--
Good Luck
BS"D


Ann said:
I am trying to move from an option group with 5 options (Option 1 through 5)
in a frame (FrameOne) on a subform (subfrmOne) that is on the first page of
a tab control (TabCtlOne) to another option group with 5 options (Option 1
through 5) in a frame (FrameTwo) on a subform (subfrmTwo) on the second page
of the tab control (TabCtlOne) with no luck. I would really appreciate any
help I can get on this? Thanks.
 

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