Results 1 to 4 of 4
  1. #1
    Lounger
    Join Date
    Nov 2005
    Posts
    48
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Password Switchboard (2000)

    I would like to implement a password when the user clicks on a specific Switchboard item.

    Any suggestions?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Password Switchboard (2000)

    You could have the switchboard item open a small form with three controls:
    - A text box whose Input Mask property has been set to Password.
    - A command button with caption OK, and whose Default property has been set to Yes.
    - A command button with caption Cancel, and whose Cancel property has been set to Yes.

    The On Click event of the OK button checks whether the password is correct, then closes the form and performs whatever action you want - open a form, print a report, ...
    The On Click event of the Cancel button merely closes the form.

    You'd have to set a password on the Visual Basic project in the database, otherwise anyone can inspect the code to see how the password is checked. And someone determined to break the security will be able to do so.

  3. #3
    Lounger
    Join Date
    Nov 2005
    Posts
    48
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Password Switchboard (2000)

    Thanks! That is exactly what I need.

    Just one more question though.....

    "The On Click event of the OK button checks whether the password is correct, then closes the form and performs whatever action you want "

    How would I check whether the password is correct or not? Do you have sample code I can use?

    Thanks,

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Password Switchboard (2000)

    That depends on what you want. You could compare to a fixed password in the code itself, for example:

    Private Sub cmdOK_Click()
    If Me.txtPassword = "Secret" Then
    DoCmd.Close acForm, Me.Name, acSaveNo
    DoCmd.OpenForm "frmSpecialForm"
    Else
    MsgBox "Password incorrect!", vbExclamation
    End If
    End Sub

    Or you could retrieve the password from a table, or something else...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •