Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2006
    Location
    UK Scotland
    Posts
    1

    Switchboard Help


    I'm having some difficulty with protecting areas of my switchboard. Does anyone know how to password protect a button of the switchboard. My main screen gives you the option of "Customer" and "Staff" I would like to have password protection on the "Staff" button so that unortharised users cant get to any of the other switchboard pages past the "Staff" button.

  2. #2
    Join Date
    Jun 2005
    Location
    Northampton, England
    Posts
    14
    You could try something like this. Although personally, I don't like password protected buttons. I would make the button Enabled = False then make it enabled when the correct user's name is entered. You could pick up the user's name from their login. I am assuming you can pick up the user's name fronm the system.

    Code:
    '***************** Code Start ***************
    Private Sub cmdOpenEmpForm_Click()
    
    'Attached to On Click event of cmdOpenEmpForm
    
        Dim strPasswd
    
        strPasswd = InputBox("Enter Password", "Restricted Form")
    
        'Check to see if there is any entry made to input box, or if
        'cancel button is pressed. If no entry made then exit sub.
    
        If strPasswd = "" Or strPasswd = Empty Then
            MsgBox "No Input Provided", vbInformation, "Required Data"
            Exit Sub
        End If
    
        'If correct password is entered open Employees form
        'If incorrect password entered give message and exit sub
    
        If strPasswd = "Graham" Then
            DoCmd.OpenForm "frmEmp", acNormal
        Else
            MsgBox "Sorry, you do not have access to this form", _
                   vbOKOnly, "Important Information"
            Exit Sub
        End If
    End Sub
    '***************** Code End ***************

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

Similar Threads

  1. Switchboard problem!
    By Suzan in forum Programming
    Replies: 1
    Last Post: 05-19-2011, 12:51 PM
  2. A Label in a Switchboard
    By Hawkx1 in forum Forms
    Replies: 1
    Last Post: 07-09-2008, 12:37 PM
  3. Exporting a Switchboard
    By Hawkx1 in forum Forms
    Replies: 1
    Last Post: 07-08-2008, 06:59 AM
  4. SWITCHBOARD MANAGER DISABLED ALL THE MENU AND EDIT OPTION
    By ranjit_dutt in forum Programming
    Replies: 0
    Last Post: 04-13-2007, 08:39 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