By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,972 Members | 1,092 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,972 IT Pros & Developers. It's quick & easy.

Automatic move to next Access tab page

P: n/a
I'm using Access 2002. My database is in Access 2000 format.

I'm designing a form to collect responses to a 40-item questionnaire.
I can fit four list boxes on a screen, so I plan to have 11 tab pages
(one page at the end for collecting identifying information) on my
form. To ease the task for the user, I'd like to have an automatic
movement to the next page. For instance, when the user clicks on the
choice for Question 4 (the last of the items on Page1), the focus
automatically shifts to Question 5 (the first of the items on Page2).

I know about entering code as an event procedure. I assume that I need
to enter code on the Event tab for the List Box that contains the
Question 4 answer.

1. For which Event do I enter the code (After Update, On Enter, On
Click)?

2. What code should I enter?

3. Can I use this same method for all of the moves from one page to
the next? (I know how to set a command to close the form. My plan is
to have a command button on the last page that says, "You may review
your answers by clicking on the tabs. When you are done, click on the
button to close the form.")

Thanks so much!Cathy
Nov 12 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On Tue, 27 Jan 2004 01:23:03 GMT, Vincent Yang wrote:
I'm using Access 2002. My database is in Access 2000 format.

I'm designing a form to collect responses to a 40-item questionnaire.
I can fit four list boxes on a screen, so I plan to have 11 tab pages
(one page at the end for collecting identifying information) on my
form. To ease the task for the user, I'd like to have an automatic
movement to the next page. For instance, when the user clicks on the
choice for Question 4 (the last of the items on Page1), the focus
automatically shifts to Question 5 (the first of the items on Page2).

I know about entering code as an event procedure. I assume that I need
to enter code on the Event tab for the List Box that contains the
Question 4 answer.

1. For which Event do I enter the code (After Update, On Enter, On
Click)?

2. What code should I enter?

3. Can I use this same method for all of the moves from one page to
the next? (I know how to set a command to close the form. My plan is
to have a command button on the last page that says, "You may review
your answers by clicking on the tabs. When you are done, click on the
button to close the form.")

Thanks so much!Cathy


First off, I use a program at my work that does something similar and it is
extremely annoying. Just because I have chosen something for that field,
does not necessarily mean I'm done with the tab or page.

If that is still what you want to do, you can move to a different tab by
using the SetFocus method of the tab page you want to move to. In the
AfterUpdate event of the last control on the page, use
Me!TabControlName.Pages("PageName").SetFocus
This is assuming there are no subforms to drill down through to get to the
tab control. This same line can be used each time it is needed. Just change
the page name to move to.

--
Mike Storr
veraccess.com
Nov 12 '05 #2

P: n/a
tom
Cathy,

I agree with Mike that automatically moving them could be confusing
and annoying to the user. How about only showing one question at a
time and providing a big [Next Question -->] button? (You could also
provide some other navigation buttons like "Previous", "First",
"Last", and "Jump" (which would give the user a list of the question
names to pick from).

If you do go with tabs, I believe you can change the current page of
a tab by setting its value property, like so: Me.TabControl.Value =
Me.TabControl.Value + 1.

If you don't use a tab control, you'll have to do some showing and
hiding of controls, which will be a bit of a headache to setup.
Whichever way you go, you may want to only populate the listboxes and
so forth for the controls that are currently visible so you don't run
into headaches with resources.

-Tom
Mike Storr <st******@sympatico.ca> wrote in message news:<16****************************@40tude.net>.. .
On Tue, 27 Jan 2004 01:23:03 GMT, Vincent Yang wrote:
I'm using Access 2002. My database is in Access 2000 format.

I'm designing a form to collect responses to a 40-item questionnaire.
I can fit four list boxes on a screen, so I plan to have 11 tab pages
(one page at the end for collecting identifying information) on my
form. To ease the task for the user, I'd like to have an automatic
movement to the next page. For instance, when the user clicks on the
choice for Question 4 (the last of the items on Page1), the focus
automatically shifts to Question 5 (the first of the items on Page2).

I know about entering code as an event procedure. I assume that I need
to enter code on the Event tab for the List Box that contains the
Question 4 answer.

1. For which Event do I enter the code (After Update, On Enter, On
Click)?

2. What code should I enter?

3. Can I use this same method for all of the moves from one page to
the next? (I know how to set a command to close the form. My plan is
to have a command button on the last page that says, "You may review
your answers by clicking on the tabs. When you are done, click on the
button to close the form.")

Thanks so much!Cathy


First off, I use a program at my work that does something similar and it is
extremely annoying. Just because I have chosen something for that field,
does not necessarily mean I'm done with the tab or page.

If that is still what you want to do, you can move to a different tab by
using the SetFocus method of the tab page you want to move to. In the
AfterUpdate event of the last control on the page, use
Me!TabControlName.Pages("PageName").SetFocus
This is assuming there are no subforms to drill down through to get to the
tab control. This same line can be used each time it is needed. Just change
the page name to move to.

Nov 12 '05 #3

P: n/a
Or use the event on exiting the last component if the user may not
have changed it's data.

Mike Storr <st******@sympatico.ca> wrote in message news:<16****************************@40tude.net>.. .
On Tue, 27 Jan 2004 01:23:03 GMT, Vincent Yang wrote:
I'm using Access 2002. My database is in Access 2000 format.

I'm designing a form to collect responses to a 40-item questionnaire.
I can fit four list boxes on a screen, so I plan to have 11 tab pages
(one page at the end for collecting identifying information) on my
form. To ease the task for the user, I'd like to have an automatic
movement to the next page. For instance, when the user clicks on the
choice for Question 4 (the last of the items on Page1), the focus
automatically shifts to Question 5 (the first of the items on Page2).

I know about entering code as an event procedure. I assume that I need
to enter code on the Event tab for the List Box that contains the
Question 4 answer.

1. For which Event do I enter the code (After Update, On Enter, On
Click)?

2. What code should I enter?

3. Can I use this same method for all of the moves from one page to
the next? (I know how to set a command to close the form. My plan is
to have a command button on the last page that says, "You may review
your answers by clicking on the tabs. When you are done, click on the
button to close the form.")

Thanks so much!Cathy


First off, I use a program at my work that does something similar and it is
extremely annoying. Just because I have chosen something for that field,
does not necessarily mean I'm done with the tab or page.

If that is still what you want to do, you can move to a different tab by
using the SetFocus method of the tab page you want to move to. In the
AfterUpdate event of the last control on the page, use
Me!TabControlName.Pages("PageName").SetFocus
This is assuming there are no subforms to drill down through to get to the
tab control. This same line can be used each time it is needed. Just change
the page name to move to.

Nov 12 '05 #4

P: n/a
"Mike Storr" <st******@sympatico.ca> wrote in message
news:16****************************@40tude.net...
On Tue, 27 Jan 2004 01:23:03 GMT, Vincent Yang wrote:
I'm using Access 2002. My database is in Access 2000 format.

I'm designing a form to collect responses to a 40-item questionnaire.
I can fit four list boxes on a screen, so I plan to have 11 tab pages
(one page at the end for collecting identifying information) on my
form. To ease the task for the user, I'd like to have an automatic
movement to the next page. For instance, when the user clicks on the
choice for Question 4 (the last of the items on Page1), the focus
automatically shifts to Question 5 (the first of the items on Page2).

I know about entering code as an event procedure. I assume that I need
to enter code on the Event tab for the List Box that contains the
Question 4 answer.

1. For which Event do I enter the code (After Update, On Enter, On
Click)?[snip]


IMO the best way to do this is to place a TextBox as the last item in the
TabOrder on each page. It is unbound and you make it so small and color it
so that it is effectively rendered invisible (but the visible property is
still true).

In this control's GotFocus event you have a line of code that sets focus to
the next desired control on the next desired TabPage. The only way that
this TextBox will ever get focus is by exiting out of the last "real"
control on your page by using <Tab> or <Enter> which is when the user will
logically want to go to the next page.

Any other method and you run the risk of overriding the user's wishes. If
they use their mouse or <Shift-Tab> to move to a different control your
code will kick in and take them someplace that they didn't want to go.
This would be confusing, irritating, and would not reflect well on the
developer of the application.
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com


Nov 12 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.