RE: Password
- From: Dave Hawks <DaveHawks@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 21 Aug 2006 02:15:02 -0700
Randy
Thanks for the suggestion, but I have no experience in passing values from a
form so I would appreciate a bit more help.
I have created the tblUsers, but I am unure of the syntax for the where
statement and how that should be inserted into my original code.
Thanks
--
Dave Hawks
"Randy Wayne" wrote:
Create a table of users. (ie. tblUsers).
Each user has a "UserID" and a "Password"
All UserIDs must be unique.
Simpley create a WHERE statement that looks at UserID and Password
Example:
UserID: dhawks
Password: pwd
Then your "test" would be:
"Select * from tblUsers WHERE UserId = '" & Me.txtUser.Value & "'AND
Password = '" Me.txtPassword & "'"
(Note single and double quotes. If you do not have experience passing a
value from a form write back.)
If BOF and EOF then '(This tests if there are any records in the recordset)
'No Match - Add code to tell user they are not allowed like your "wrong
password"
Else
'There is a match -- add code to allow them to delete
End if
Let me know if this helps
Randy
"Dave Hawks" wrote:
I am using the following code to limit the ability of users to delete records.
Private Sub Player1_BeforeUpdate(Cancel As Integer)
Dim Response As String
Dim Password, Loggin
Password = "pwd"
If Not IsNull(Player1.OldValue) Then
Response = MsgBox("To avoid unauthorised deletions please enter your
password ", vbOKOnly)
If Response = vbOK Then
Loggin = InputBox("Enter Password")
If Loggin <> Password Then
MsgBox "Wrong Password"
Cancel = True
Player1.Undo
Else
End If
End If
End If
End Sub
I would like to allocate each user their own password, can anyone suugest a
method of comparing the entered password against a list of allowable
passwords.
--
Dave Hawks
- Follow-Ups:
- RE: Password
- From: Randy Wayne
- RE: Password
- References:
- RE: Password
- From: Randy Wayne
- RE: Password
- Prev by Date: Re: record locking
- Next by Date: Complex Query?
- Previous by thread: RE: Password
- Next by thread: RE: Password
- Index(es):
Relevant Pages
|