Tab through tabs

G

Guest

I hope someone can help, on the face of it, i thought this would be simple.

I have a form that to keep all of the field on one screen I have used tabs
to hold some of the fields. I have set the tab order to ensure that the form
tabs through the main form and the first page of the tabs but cannot get it
to move onto the next tab is there a way that by using the tabkey I can
continue onto the subsequent pages.

AS I cannot find comething in properties I presume I need to use code, if
this is the case could you tell me where I need to put the code, sorry I have
used code in the past with help from here only.

Thanks

Phil
 
R

Rick Brandt

Phil said:
I hope someone can help, on the face of it, i thought this would be
simple.

I have a form that to keep all of the field on one screen I have used
tabs to hold some of the fields. I have set the tab order to ensure
that the form tabs through the main form and the first page of the
tabs but cannot get it to move onto the next tab is there a way that
by using the tabkey I can continue onto the subsequent pages.

AS I cannot find comething in properties I presume I need to use
code, if this is the case could you tell me where I need to put the
code, sorry I have used code in the past with help from here only.

Place a tiny (but visible = true) TextBox on each TabPage and make it last
in the TabOrder on that page. In its GotFocus event run code that sets
focus to the desired control on the desired TabPage. When the user tabs out
of the last "real" control on each page then the code will take them to the
next page.
 
G

Guest

Rick thatnks for your reply, I have managed to do it by putting the code
me.page1.setfocus in the exit code for the last control on page 0 of the tab
which works.

Now I have another problem the form initially tabs through some fields that
are not onthe tabbed form. when I start inputting the first record it now
goes through the first fields page 1 and page 2 of the tabs and starts a
second blank record but this second record only completes the fields of the
tab and page two of the tabbed form (page 2 is the tab in focus now)

I presume I can add some code to the last field before the tabs to ensure
page 1 is the focus but what code do i use

sorry this is a long reply for what must be simple

hope someone can help

thanks#

Phil
 
R

Rick Brandt

Phil said:
Rick thatnks for your reply, I have managed to do it by putting the
code me.page1.setfocus in the exit code for the last control on page
0 of the tab which works.

I don't recommend that approach. If your user uses Shift-Tab to go
backwards when on the last control or uses the mouse to select another
control your on-exit code will override what they wanted to do and force
them to the next TabPage. The method I described would not do that.
Now I have another problem the form initially tabs through some
fields that are not onthe tabbed form. when I start inputting the
first record it now goes through the first fields page 1 and page 2
of the tabs and starts a second blank record but this second record
only completes the fields of the tab and page two of the tabbed form
(page 2 is the tab in focus now)

I presume I can add some code to the last field before the tabs to
ensure page 1 is the focus but what code do i use

sorry this is a long reply for what must be simple

Use the same strategy to go from the last control on Tab Page 2 back to the
desired control.
 
G

Guest

thanks Rick

I have tried that this morning and it works for moving through the tabs, I
used an unbound textbox with the code me.tabctl69.pages(0).setfocus to get on
the tab from the fields on the form which ensures page 0 is always the first
page and at the end of page 0 I use me.histology.setfocus in a text box to
get to page 1, I am now stuck in a loop the tab control will not move back
onto the main form so i continue to tab through page 0 and 1 of the tab
control. i have set an unbound textbox as the last control on the last tab
and i need code to refer to the next control on the main form the form is
called Gynaeform and the control is Add Record how do I word the code to get
on back on the main form

thanks a lot for your help so far

thanks

Phil
 
R

Rick Brandt

Phil said:
thanks Rick

I have tried that this morning and it works for moving through the
tabs, I used an unbound textbox with the code
me.tabctl69.pages(0).setfocus to get on the tab from the fields on
the form which ensures page 0 is always the first page and at the end
of page 0 I use me.histology.setfocus in a text box to get to page 1,
I am now stuck in a loop the tab control will not move back onto the
main form so i continue to tab through page 0 and 1 of the tab
control. i have set an unbound textbox as the last control on the
last tab and i need code to refer to the next control on the main
form the form is called Gynaeform and the control is Add Record how
do I word the code to get on back on the main form

thanks a lot for your help so far

Instead of using SetFocus to change the TabControl Back to Page 1 just use...

Me.tabctl69.Value = 0

....then follow that line with one that sets focus where you want it.
 
G

Guest

Hi Rick I have changed that it works great.

the only problem I have now is how to tab back to the start of the record

I have 5 fields Histology, Cancer, Forename, Surname, DOB on the main form.
from the unbound textbox tab takes me to page one (0) of the tabcontrol the
last field on page 1 takes me to page 2 of the tabcontrol which tabs through
all the fields I need however when it gets to the end tab takes me back to
page 1 of the tab.

i would like it to go to the first field [Histology] of the next record on
the mainform [GynaeForm] I have a textbox on the lastpage of the tab what
code do i need to use to go to that field.

This is the last thing i need for the form to be complete.

thanks for all your help so far

Thanks

Phil
 

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