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
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