General discussion


Microsoft access Security Question

By Zachary.Diamond ·
I am trying to keep users from getting into a certain form in a database. Here is the code so far. I don't know how to close it out if the password fails.
Sub Logon()
'Variable Declaration Section
Dim Username
Dim Password
Dim qresult1
Dim qresult2
'Variable Definition Section
Username = InputBox( _
"Welcome to Citi Commerce Solution Employee Resolution." & _
Chr(13) & Chr(13) & _
"Please enter your username.")
Password = InputBox( _
"You're doing a great job!" & _
Chr(13) & Chr(13) & _
"Now, please enter your password")
'Query Execution Section
qresult1 = DLookup("[Username]", "FirstTable", "[Username] = username")
qresult2 = DLookup("[Password]", "FirstTable", "[Password] = password")
'Processing Logic Section
If Username = qresult1 And Password = qresult2 Then
MsgBox "Congratulations, Please Enter Information!", vbOKOnly
MsgBox "Hey! That's not right!" & Chr(13) & "Please retype Password!", vbRetryCancel
End If
End Sub

This conversation is currently closed to new comments.

1 total post (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -


by Chris A In reply to Microsoft access Security ...

I am not sure of the code of the top of my head but if you make a new form make new button start wizard and select Application Quit. It will create the code to close Access.

Chris Allen

Back to Security Forum
1 total post (Page 1 of 1)  

Related Discussions

Related Forums