Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Dec 2006
    Thanked 0 Times in 0 Posts

    a set form password (2003)


    I have a form which I want to assign the password "test" to. I will be applying this password on the "on load' event. the name of the form is "frmInvoice". What is the best way to do this? Thanks.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 28 Times in 28 Posts

    Re: a set form password (2003)

    What do you mean by "assign the password"? That the user has to enter the correct password in order to open the form? If so, the On Load event is not the appropriate one, since you cannot cancel the opening of the form from it. You could use the On Open event:

    Private Sub Form_Open(Cancel As Integer)
    If Not InputBox("Enter the password") = "Test" Then
    MsgBox "Wrong!", vbExclamation
    Cancel = True
    End If
    End Sub

    If you really want to secure the database, you should apply user-level security. See WendellB's tutorial The Secrets of Security.

Posting Permissions

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