Password on dedicated forms

kentendresen

Registered User.
Local time
Today, 22:35
Joined
Nov 13, 2002
Messages
49
I've made a main menu, and the user can navigate to different forms from the menu. I want some of the forms to be password-protected, is that possible?

How do I make a password dialog box?

I'm a rookie! ;o)

Thx!
 
This is a simple way to call an input box that allows the user to key a password and if correct it will open a form.
Assign this code to the OnClick event of the button to open the form that you want password protected.

Code:
    Dim strInput As String
    Dim strMsg As String
    
    Beep
    strMsg = "This form is used only by the ''Special Form'' people." & vbCrLf & vbLf & "Please key the ''Special Form'' password to allow access."
    strInput = InputBox(Prompt:=strMsg, title:="Inventory Audit Password")
    If strInput = "SpecialFormPassword" Then 'password is correct
        DoCmd.OpenForm "YourSpecialFormNameHere"
        DoCmd.Close acForm, Me.Name
    Else 'password is incorrect
        MsgBox "Incorrect Password!" & vbCrLf & vbLf & "You are not allowed access to the ''Special Form''.", vbCritical, "Invalid Password"
        Exit Sub
    End If
You can not format an input box!

HTH
 

Users who are viewing this thread

Back
Top Bottom