Results 1 to 7 of 7
  1. #1
    freemail is offline Novice
    Windows XP Access 2003
    Join Date
    May 2013
    Posts
    4

    Question How can i control TabCtl by making it visible or invisible as per the user data

    Hello all




    This is the first time for me in this Forum, I need some help to control the TabCtl
    I need to make some tabs to be visible, invisible, enabled or disabled. All this actions but as per the data in the table "permission"
    I mean that when the user open the form he can see only the tabs that allowed for him to only see it or to see and write the data


    I attached the db to be clear


    Thanks for all
    Attached Files Attached Files

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Example code from my db:
    Code:
    Private Sub Form_Open(Cancel As Integer)
    With Me
    .tbxSet = TestSet(.tbxLABNUM, "Soils & Aggregate")
    .pge1.Visible = True
    .pge2.Visible = True
    .pge3.Visible = True
    .pge4.Visible = True
    .pge5.Visible = True
    .pge6.Visible = True
    .tbxLABNUM.SetFocus
    'use Val to capture characters preceeding :### which will be present if gradation test selected
    If Not Val(.tbxSet) Like "*1*" Then
        .pge1.Visible = False
        '.ctr1.SourceObject = ""
    End If
    If Not Val(.tbxSet) Like "*2*" Then
        .pge2.Visible = False
        '.ctr2.SourceObject = ""
    End If
    If Not Val(.tbxSet) Like "*3*" And Not Val(.tbxSet) Like "*E*" Then
        .pge3.Visible = False
        '.ctr3.SourceObject = ""
    End If
    If Not .tbxSet Like "*P*" Then
        .pge4.Visible = False
        '.ctrProctor.SourceObject = ""
    End If
    If Not .tbxSet Like "*V*" Then
        .pge5.Visible = False
        '.ctrVibratory.SourceObject = ""
    Else
        .pge2.Visible = False
    End If
    If Not .tbxSet Like "*H*" Then
        .pge6.Visible = False
    End If
    If .pge6.Visible Then
        .pge6.SetFocus
    ElseIf .pge1.Visible Then
        .pge1.SetFocus
    ElseIf .pge2.Visible Then
        .pge2.SetFocus
    ElseIf .pge3.Visible Then
        .pge3.SetFocus
    ElseIf .pge4.Visible Then
        .pge4.SetFocus
    ElseIf .pge5.Visible Then
        .pge5.SetFocus
    End If
    End With
    End Sub
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    freemail is offline Novice
    Windows XP Access 2003
    Join Date
    May 2013
    Posts
    4
    Thanks June7 for your help

    I don't Know how to apply this code on my db, Please can you apply this on my db, but as per the permissions for each user.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    You need to somehow identify who the user is then what their permissions are. Do you have a table of users with username and permission level?

    strPermission = Nz(DLookup("Permission", "Users", "Username='" & Environ("USERNAME")),"")
    If strPermission <> "" Then
    'code to set tab pages, I don't know your db so can't be more specific
    End If
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    freemail is offline Novice
    Windows XP Access 2003
    Join Date
    May 2013
    Posts
    4
    I attached my db with my first post, please check it and you will know what i need

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    I don't want to build this for you. Adapt the examples to your situation and post attempted code for analysis if you encounter specific issue.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    freemail is offline Novice
    Windows XP Access 2003
    Join Date
    May 2013
    Posts
    4
    OK thanks for your help, I will try to do it.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Making a Command Buttong Visible/Invisible
    By Lupson2011 in forum Forms
    Replies: 3
    Last Post: 02-16-2012, 12:03 PM
  2. Making subform field visible/invisible
    By Snufflz in forum Forms
    Replies: 3
    Last Post: 01-17-2011, 05:30 AM
  3. Invisible/visible box
    By teirrah1995 in forum Forms
    Replies: 4
    Last Post: 10-03-2010, 02:45 AM
  4. Setting fields visible/invisible
    By col5473 in forum Forms
    Replies: 1
    Last Post: 09-17-2010, 09:14 AM
  5. Combo Boxes Visible/Invisible
    By Rick West in forum Forms
    Replies: 2
    Last Post: 07-06-2010, 09:41 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums