Solved

MS Access 2013 Control Button to Navagate Tabs

Posted on 2013-12-20
3
700 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 119

Accepted Solution

by:
Rey Obrero earned 500 total points
Comment Utility
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
Comment Utility
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)
Comment Utility
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

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…
Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

743 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now