Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Password 1

Status
Not open for further replies.

krnsmartazz

Technical User
Dec 13, 2001
134
0
0
US
Make user enter password when he or she tries to enter form
 
Private Sub Button10_Click()
On Error GoTo Err_Button10_Click
Dim DocName As String
Dim LinkCriteria As String

Msg = "Enter a Password ?"
Title = "System maintance password"
Defvalue = "1" ' Set default return value.
'answer = InputBox(msg, title, Defvalue) ' Get user input.
answer = GetPass(1)
answer = a_form_responce

If answer = "pass" Then
DocName = "Z_maintance"
DoCmd.OpenForm DocName, , , LinkCriteria
Exit_Button10_Click:
Exit Sub
Err_Button10_Click:
MsgBox Error$
Resume Exit_Button10_Click
Else
End If

End Sub
 
i'm having trouble
could you send me a working example
krnsmartazz@yahoo.com
 
Attach this code to your form.
Note- Change the blue to the password you want for the form.


Private Sub Form_Open(Cancel As Integer)

If InputBox(&quot;What Is The Password?&quot;) <> &quot;Password&quot; Then
MsgBox &quot;Invalid Password&quot;
Cancel = True
End If

End Sub
 
Here's a password sub I use that asks for a password to open the table tblCWR. It's pretty simple and not too secure but it discourages the casual user.

Private Sub edit_table_Click()
On Error GoTo Err_edit_table_Click
Dim strInput As String
Dim strMsg As String
strMsg = &quot;Enter your Password&quot;
strInput = InputBox(prompt:=strMsg, _
Title:=&quot;User Password&quot;, xpos:=2000, YPos:=2000)
If strInput = &quot;santarosa&quot; Then
DoCmd.OpenTable &quot;tblCWR&quot;, acViewNormal
Else
msgbox (&quot;Wrong Password&quot;)
End If
Exit_edit_table_Click:
Exit Sub

Err_edit_table_Click:
msgbox Err.Description
Resume Exit_edit_table_Click

End Sub
 
Anybody have a routine where astericks are added as you type, an &quot;On change&quot; event....
 
Set the input mask property to password...

BTW, in the future, please create a new thread instead of tagging on someone else's. This way, when we respond the original creator of the thread doesn't get emailed needlessly... Terry
**************************
* General Disclaimor - Please read *
**************************
Please make sure your post is in the CORRECT forum, has a descriptive title, gives as much detail to the problem as possible, and has examples of expected results. This will enable me and others to help you faster...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top