Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2006
    Location
    dallas
    Posts
    14

    Swicthboard


    I have my switchboard. On the main switchboard i have a button that only the supervisor needs to access how can i disable it by keying off current uer?

  2. #2
    Join Date
    Sep 2006
    Posts
    5
    Try something like this.......in your Switchboard Form's Form_Load() Sub
    1) Replace btnSupervisorOnly with your button object's name
    2) You do not really need the string variable (sCurrentUser)

    I just used it to show that it gets the Current User value from the CurrentUser function
    3) MsgBox() call is for informational purposes only



    MsgBox ("The current user is: " & CurrentUser)

    Dim sCurrentUser As String
    sCurrentUser = CurrentUser

    If sCurrentUser = "Admin" Then
    Me.btnSupervisorOnly.Enabled = True
    Else
    Me.btnSupervisorOnly.Enabled = False
    End If


    I hope this helps.

  3. #3
    Join Date
    Sep 2006
    Location
    dallas
    Posts
    14
    thanks that worked great

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

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