Hide a specific page from Tab Control

Posted on 2009-12-16
Last Modified: 2012-06-27
Hello Everyone,
I have a form with a textbox called: "AccessLevel" this textbox indicates if the user is an Admin or User after they sign in. On the same form I have a Tab Control with several pages with different functions. Is there a way to place code so that if the user is signed in as a "User" a specific page for example "Reports" is invisible. If possible in which event should I place this code
Question by:joeserrone
    LVL 75

    Expert Comment

    by:DatabaseMX (Joe Anderson - Access MVP)
    Sure ...

    Me.tabTestPg2.Visible = False  ' or True

    The code most likely would go in the Form OnLoad ... after you figure out admin rights.

    LVL 39

    Accepted Solution

    In the open event put something like:
    Private Sub Form_Open ()
    If user =  "User" then
    PageName.Visible = False
    End If
    End Sub
    LVL 75

    Expert Comment

    by:DatabaseMX (Joe Anderson - Access MVP)

    Select Case Me.txtAccessLevel

        Case "User"
        Me.YourTabPage.Visible = False  ' or True
        Case "Admin"
            Me.YourTabPage.Visible = True ' or False
        Case "AndSoOn"
           '  do it again
    End Select

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
    Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

    728 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

    18 Experts available now in Live!

    Get 1:1 Help Now