Solved

MS Access 2013 Control Button to Navagate Tabs

Posted on 2013-12-20
3
723 Views
Last Modified: 2013-12-24
I have a Main Form with several Navigation Tabs attached to it (tabs are hidden).  It's important that I use a Control Button on each tab/form ('Next') to dictate which tab/form to display next.  The order of the tab/forms to be displayed is not necessarily consecutive (1, 2, 3, 4...), but rather, depends on selections made on Option Groups embedded within each tab/form.  

Question1:  Does anyone have a code I can use within my Control Buttons to say "If clicked, display next tab/form?"

Question 2:  Does anyone have a code I can use within my Control Buttons to say "If clicked-- and based on this Option Group Selection, open this tab/form?

Any help would be much appreciated.  *Apologies, but be as basic/hand-holding as possible in your wording—I’m a total Access rookie!
0
Comment
Question by:mdstalla
3 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 39733060
it will help if you upload a copy of the db, so we can see what kind of control you actually have.

a good combination for this type of setup is Tab Control and Option Group with Toggle buttons.


using the AfterUpdate event of the Option Group

private sub frame0_afterupdate()

select case me.frame0
      case 1
          me.tabctl0.pages(0).setfocus
      case 2
          me.tabctl0.pages(1).setfocus


end select

end sub


or use the name of the tab


private sub frame0_afterupdate()

select case me.frame0
      case 1
          me.tabctl0.pages("page1").setfocus
      case 2
          me.tabctl0.pages("page2").setfocus


end select

end sub
0
 
LVL 21
ID: 39734178
I have created similar "Wizard" style forms that work like what you need.

I have a a working example that should help:

Wizard Form template
This database has a form that uses a tab control to create a wizard style look. The tabs are hidden. There an back/next command buttons to navigate between the tab control's pages.

** Updated 1/9/2010 to handle an issue with Access 2010.
0
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 39735899
Besides code like Capricorn1 suggests above, I assume you are going to need "Back" buttons as well, so you need to keep track of the previous tab you were on.

I generally do that in an array

When you click the "Next" button, save the current tab number in an array and use an array pointer variable to keep track of where you are in the array.  Then move on to the next tab using code similar to Capricorn1's above.

Then, if the user clicks Back instead of next, you can use the pointer to determine the appropriate element of the array and go to that tab.  Reminder, when you move back, don't forget to decrement the value of your array pointer.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As with any other System Center product, the installation for the Authoring Tool can be quite a pain sometimes. This article serves to help you avoid making these mistakes and hopefully save you a ton of time on troubleshooting :)  Step 1: Make sur…
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question