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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

distinct dlookup function

Status
Not open for further replies.

wshs

Programmer
Nov 22, 2005
220
US
i thought this coding was working fine but...
just find one problem.
it's suppose to match the password and the staffid from the table but i can bypass it by entering any password from the table.
ie. staffID | password
steve st
david dv

it should only let them pass only if StaffID = Steve and pw= st but i can bypass by entering steve, dv...
how can i fix this problem?
below is my current coding.
Private Sub Command5_Click()
If Me!password = DLookup("[password]", "tbl_BMonitor", "[password]='" & Me!password & "'") And Me!staffid = DLookup("[StaffID]", "tbl_BMonitor", "[StaffID]='" & Me!staffid & "'") Then
DoCmd.OpenForm FormName:="frm_Main"
Else
MsgBox "Invalid password"
End If
End Sub
 
If Me!password = DLookup("password", "tbl_BMonitor", "password='" & Me!password & "' AND StaffID='" & Me!staffid & "'") Then

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
my life saver.. as alway~ thx =)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top