• Access Tips Using a tab control to create a menu screen

  • Access Database Deveopers Tips  – Using a Tab Control to Create a Menu Screen

    You can create a simple menu screen with little effort by using a combination of a tab control and some buttons. In the below example I have created a tab control with three pages (each page has buttons on them in the example but you can put whatever you want on your pages) and three buttons (“Main”, “Reports”, “Data Entry”) at the top of the form which we will use to show the appropriate page when clicked.

     

    Access – using a tab control to create a menu screen 1

     

    For each page, I change their “Name” to something a bit more sensible as we will be using this name later in some code we will write (NB I also changed the tab control name to something more appropriate, as well as the names for the buttons that I will be using). The example below shows the name I chose for the first page (“Page 1” above).

     

    Access – using a tab control to create a menu screen 2

     

    With the tab control I now change the “Style” option to “None”. This hides the page selection row from view. Obviously this means we cannot select the pages using this function now, which is why we created the three buttons at the top of the form, as we will be using them to select the pages instead.

     

    Access – using a tab control to create a menu screen 3          Access – using a tab control to create a menu screen 4

     

    For each of the three buttons at the top of the form, I changed their “On Click” Event to “[Event Procedure]” and press the “…” button beside this to access the VBA code.

     

    Access – using a tab control to create a menu screen 5

     

    The VBA code window should open at the buttons “_Click()” event procedure and all you need to do is adapt the code below (adjusting for the tab control name you used earlier and the page name of the page you want to display). In my example below, “tabMenu” is the Tab Control name and “pageMain” is the name of the Page I want to display.

    Private Sub butMain_Click()

    tabMenu.Value = pageMain.PageIndex

    End Sub

    Now when you click on a button, the menu options will change to the appropriate tab.

     

    Access – using a tab control to create a menu screen 6     Access – using a tab control to create a menu screen 7

     

    Read more about Access Development Projects

    A leading European Private Equity Practice came to Xlteq to design and build a bespoke CRM tool to manage and track their investment managers, their clients, and investment opportunities. 

    Find out more

    Bristol based specialist waste paper brokerage and waste management consultancy came to Xlteq to review and enhance an existing order tacking tool built in Microsoft Access.

    Find out more

    Kent based bespoke background screening company asked Xlteq to automate the collection and upload of data necessary for regulatory background checks via an external agency online portal.

    Find out more