Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / May 2008

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jimbo213 - 07 May 2008 23:44 GMT
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 page<1>
At the last field, press tab again and it goes back to field1 on page<1>.

How can I get the keyboard-tab to go to field1 on page<2> ?

Signature

Thanks for your reply & assistance.
Jimbo213

Rick Brandt - 08 May 2008 00:43 GMT
> I have a form with tab-control.  It now has five "pages" using Access
> Terminology [I thought they were called tabs, but oh well...]
[quoted text clipped - 4 lines]
>
> How can I get the keyboard-tab to go to field1 on page<2> ?

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.

Signature

Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt   at   Hunter   dot   com

Jimbo213 - 08 May 2008 21:37 GMT
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.

Signature

Thanks for your reply & assistance.
Jimbo213

> > I have a form with tab-control.  It now has five "pages" using Access
> > Terminology [I thought they were called tabs, but oh well...]
[quoted text clipped - 18 lines]
> or clicks his mouse to go to some other control your code will circumvent
> their wishes and take them someplace else.
Rick Brandt - 09 May 2008 00:06 GMT
> Thanks Rick - that worked real slick.
>
[quoted text clipped - 14 lines]
>
> 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

Signature

Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt   at   Hunter   dot   com

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.