Hello guys
I have a button on a form to open another form, what I want to when you press the button it shows me prompt to enter a password so I can watch the other form.
Thank you .
Hello guys
I have a button on a form to open another form, what I want to when you press the button it shows me prompt to enter a password so I can watch the other form.
Thank you .
If you are on network, you can use LOGIN AUTHENTICATION...
Code:Public Sub BUTTON1_CLICK() if WindowsLogin() then docmd.openForm "frmSecretForm" End sub Public Function WindowsLogin(ByVal strUserName As String, ByVal strpassword As String, ByVal strDomain As String) As Boolean 'Authenticates user and password entered with Active Directory. On Error GoTo IncorrectPassword Dim oADsObject, oADsNamespace As Object Dim strADsPath As String strADsPath = "WinNT://" & strDomain Set oADsObject = GetObject(strADsPath) Set oADsNamespace = GetObject("WinNT:") Set oADsObject = oADsNamespace.OpenDSObject(strADsPath, strDomain & "\" & strUserName, strpassword, 0) WindowsLogin = True 'ACCESS GRANTED ExitSub: Exit Function IncorrectPassword: WindowsLogin = False 'ACCESS DENIED Resume ExitSub End Function
Thank you ranman256
I use this code
But how do I convert the letters to the Star
Code:Dim strInput As String Dim strMsg As String Beep strMsg = "Please Enter the password to allow access." strInput = InputBox(Prompt:=strMsg, Title:="Special Password") If strInput = "12345" Then 'password is correct DoCmd.OpenForm "Parts", acFormDS, "", "", , acNormal DoCmd.Close acForm, Me.Name Else 'password is incorrect MsgBox "Incorrect Password!" & vbCrLf & vbLf & "You are not allowed access to the ''sales form''.", vbCritical, "Invalid Password" Exit Sub End If