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

Automatically moving from tab to tab

iBasho
P: 16
I have developed a form with 5 tabs (2 of which have subforms). Currently, the users get to each tab by clicking on the tab at the top when they are finished entering data on that page. (it does not move to the next tab when the user gets to the bottom of the page. I do have two subform on tabs 2 and 4 which will allow a user to add unlimited number of records). Is there a way that the focus will move to the next tab once the user reaches the last field on the previous page? Is there anything special that needs to be done on the tabs that have subforms?

Thanks in advance for your help!
Mar 2 '07 #1
Share this Question
Share on Google+
5 Replies


MSeda
Expert 100+
P: 159
you can use the following code to go to another page when the Tab key is pressed.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Equipment_Notes_KeyDown(KeyCode As Integer, Shift As Integer)
  2.  
  3. If KeyCode = 9 Then ' 9 is the tab key
  4. DoCmd.GoToControl "Page77" 'what ever the name of you page is
  5. End If
  6.  
  7. End Sub
you could also add the keycode for the arrow keys if you like
Mar 2 '07 #2

iBasho
P: 16
Thanks for the reply MSeda. Unfortunately it did not yield good results.
When I tab through the fields and I am on the last field for that page it enters a new record and the focus does not move to the next tab (page). Even when I am finished tabing through that second record it returns the focus on the first field of the first record on that same tab (page).

This is the code I entered:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Equipment_Notes_KeyDown(KeyCode As Integer, Shift As Integer)
  2. If KeyCode = 9 Then
  3. DoCmd.GoToControl (Page3)
  4. End If
  5. End Sub
Mar 5 '07 #3

Rabbit
Expert Mod 10K+
P: 12,365
Have you tried "Page3" like in MSeda's example instead of (Page3)?

You might also want to make sure it's the last control on the tab before executing the code with a .TabIndex check.
Mar 5 '07 #4

iBasho
P: 16
Thanks Rabbit. Fixed the problem.
Mar 5 '07 #5

Rabbit
Expert Mod 10K+
P: 12,365
Not a problem.
Mar 5 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.