I have a form that takes a logon id and password from a sql linked table, I read some of the article regarding this issue but i seems on all of then the same. But in this code its not applying can any one provide me an advice what i'm doing wrong :)
Private Sub cmdEnter_Click()
On Error GoTo Err_cmdEnter_Click
Dim db As Database
Dim rs As Recordset
RetVal = SysCmd(acSysCmdSetStatus, "Starting Joseph Stevens Access Application......")
Set db = CurrentDb
Set rs = db.OpenRecordset("select * from tblSecurity where logonid='" & txtLogonID & "' and password='" & txtPassword & "';", dbSeeChanges)
If rs.EOF Then
MsgBox "Invalid Logon/Password Combination", vbCritical, "Access Denied"
txtLogonID = ""
txtPassword = ""
cmdEnter.Default = False
lOkToLoad = True
nSecurityLevel = rs!SecurityLevel
strRights = IIf(IsNull(rs!Rights), "", rs!Rights)
strLogonID = IIf(IsNull(rs!LogonID), "", rs!LogonID)