A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

How to get the keyboard-tab key to go next Page on a tab-control f



 
 
Thread Tools Display Modes
  #1  
Old May 7th, 2008, 11:44 PM posted to microsoft.public.access.forms
Jimbo213
external usenet poster
 
Posts: 40
Default 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  
Old May 8th, 2008, 12:43 AM posted to microsoft.public.access.forms
Rick Brandt
external usenet poster
 
Posts: 4,354
Default 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  
Old May 8th, 2008, 09:37 PM posted to microsoft.public.access.forms
Jimbo213
external usenet poster
 
Posts: 40
Default 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  
Old May 9th, 2008, 12:06 AM posted to microsoft.public.access.forms
Rick Brandt
external usenet poster
 
Posts: 4,354
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:56 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.