If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
How to get the keyboard-tab key to go next Page on a tab-control f
I have a form with tab-control. It now has five "pages" using Access Terminology [I thought they were called tabs, but oh well...] When the keyboard-tab key is pressed it goes through all the fields on page1 At the last field, press tab again and it goes back to field1 on page1. How can I get the keyboard-tab to go to field1 on page2 ? -- Thanks for your reply & assistance. Jimbo213 |
#2
|
|||
|
|||
How to get the keyboard-tab key to go next Page on a tab-control f
Jimbo213 wrote:
I have a form with tab-control. It now has five "pages" using Access Terminology [I thought they were called tabs, but oh well...] When the keyboard-tab key is pressed it goes through all the fields on page1 At the last field, press tab again and it goes back to field1 on page1. How can I get the keyboard-tab to go to field1 on page2 ? A good and simple method is to add a tiny TextBox as the last control in the TabOrder of each page. In its GotFocus event have a line of code that sets focus to the first control on the next TabPage. This TextBox must have its visible property set to true so it can get focus (albeit briefly), but it can be made so small that the user wil not be able to see it. What is good about this method is that the user is only taken to the next page if they leave your last control with the Enter key or the Tab key, in other words just as if the TabOrder was doing what you wanted. Some advise using the LostFocus or Exit event of your last control to set focus to the first control on the next page, but that means if the user presses Shift-Tab or clicks his mouse to go to some other control your code will circumvent their wishes and take them someplace else. -- Rick Brandt, Microsoft Access MVP Email (as appropriate) to... RBrandt at Hunter dot com |
#3
|
|||
|
|||
How to get the keyboard-tab key to go next Page on a tab-contr
Thanks Rick - that worked real slick. Now - I'm on the last page. How do I jump to the first text box on the first page & next record I created a new text box at the end of the last page. I want to go to [CompanyBox] on page1 and the next record. This code does jump to CompanyBox but within the same record. =Forms!frmD7MASTER!CompanyBox.setfocus Here's what I tried [just to show you I'm not a lazy lurker!!] I created a macro NextRecord_Company and put it in On Got Focus I put =Forms!frmD7MASTER!CompanyBox.setfocus in On Lost Focus and I got the error "you can't go to the specified record. You may be at the end of a recordset." What will work? Thanks. -- Thanks for your reply & assistance. Jimbo213 "Rick Brandt" wrote: Jimbo213 wrote: I have a form with tab-control. It now has five "pages" using Access Terminology [I thought they were called tabs, but oh well...] When the keyboard-tab key is pressed it goes through all the fields on page1 At the last field, press tab again and it goes back to field1 on page1. How can I get the keyboard-tab to go to field1 on page2 ? A good and simple method is to add a tiny TextBox as the last control in the TabOrder of each page. In its GotFocus event have a line of code that sets focus to the first control on the next TabPage. This TextBox must have its visible property set to true so it can get focus (albeit briefly), but it can be made so small that the user wil not be able to see it. What is good about this method is that the user is only taken to the next page if they leave your last control with the Enter key or the Tab key, in other words just as if the TabOrder was doing what you wanted. Some advise using the LostFocus or Exit event of your last control to set focus to the first control on the next page, but that means if the user presses Shift-Tab or clicks his mouse to go to some other control your code will circumvent their wishes and take them someplace else. -- Rick Brandt, Microsoft Access MVP Email (as appropriate) to... RBrandt at Hunter dot com |
#4
|
|||
|
|||
How to get the keyboard-tab key to go next Page on a tab-contr
Jimbo213 wrote:
Thanks Rick - that worked real slick. Now - I'm on the last page. How do I jump to the first text box on the first page & next record I created a new text box at the end of the last page. I want to go to [CompanyBox] on page1 and the next record. This code does jump to CompanyBox but within the same record. =Forms!frmD7MASTER!CompanyBox.setfocus Here's what I tried [just to show you I'm not a lazy lurker!!] I created a macro NextRecord_Company and put it in On Got Focus I put =Forms!frmD7MASTER!CompanyBox.setfocus in On Lost Focus and I got the error "you can't go to the specified record. You may be at the end of a recordset." What will work? Thanks. Sorry, I know next to nothing about doing stuff with macros. What would work in VBA is... Me.DesiredControl.SetFocus DoCmd.RunCommand acCmdRecordsGoToNext -- Rick Brandt, Microsoft Access MVP Email (as appropriate) to... RBrandt at Hunter dot com |
Thread Tools | |
Display Modes | |
|
|