Solved

MS Access 2013 Control Button to Navagate Tabs

Posted on 2013-12-20
3
738 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 48

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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Outlook for dependable use in a very small business   This article is about using the Outlook application (part of Microsoft Office) in a very small business, or for homeowners where dependability and reliability are critical requirements. This …
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

707 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