Matching Table Data

partizan82

Registered User.
Local time
Today, 12:20
Joined
May 23, 2002
Messages
17
I'm somewhat new to VBA & Access and i need to do something important here.... so don't screem at me if i ask dumbass questions...

My problem:

I have a table <Employees> with to columns <EmployeeID> and <Password> and I have a log in form <LogIn> with 2 fields and a button that suppose to check for user ID and find it in the table and find out if password matches to the corresponding one in the table... if so it lets the user in to the next form...
So how do i look for the user in the table after he types his name and password to see if it corresponds the one in the table? Could anyone explain to me please how to do that?
 
The answer is DLookup.

If DLookup("[Password]", "Employees", "[EmployeeID] = " & Me.EmployeeID) = Me.txtPassword Then
'Open the next form
Else
MsgBox "You have entered an incorrect password.", vbOKOnly, "Incorrect Password"
End If

I have assumed that the field on the form where the user enters the password is called txtPassword and that the field that holds the User ID is called EmployeeID.

[This message has been edited by scottfarcus (edited 05-23-2002).]
 
Thanks a lot for help, i'll try it out now and tell you if it works...
 
It works...
smile.gif


Thank you very much scottfarcus!

P.S. Best forum ever...
 

Users who are viewing this thread

Back
Top Bottom