Password protect a form

  • Thread starter Thread starter steviebiddles
  • Start date Start date
S

steviebiddles

Guest
How can i simply prompt the user for a password when they click a button, if the password does not match the form will not open?
 
You can mess about with what is displayed, but its quite simple.

Hope this helps - code below

Code:
    Dim stDocName As String
    Dim stLinkCriteria As String
    Dim PassWordtxt
    
    
    PassWordtxt = InputBox("Please Type in password")

If PassWordtxt = "password" Then

    stDocName = "NAME_OF_FORM_TO_OPEN"
    DoCmd.OpenForm stDocName, , , stLinkCriteria
Else

MsgBox "The password provided was incorrect - you do not have permission"

End If
 

Users who are viewing this thread

Back
Top Bottom