Can anyone tell me why this doesnt work? I have a form with two text
boxes (username and password) and this is the event I want to run after
the two boxes are filled in. (Click event for a button)
Dim user As String
Dim pass As String
If pass <> "" Then
pass = Me.Password
Else
pass = "yyyyyyyyyyyyy"
End If
If user <> "" Then
user = Me.Username
Else
user = "xxxxxxxxxxxxx"
End If
Dim db As Database
Dim rs As Recordset
Dim str As String
str = "Select * From [operators] Where [username]= '" & user & "'_ AND
[password] = '" & pass & "'"
Set db = CurrentDb
Set rs = db.OpenRecordset(str)
rs.MoveLast
If rs.RecordCount <> 0 Then
MsgBox "Match found"
Else
MsgBox "No Match found"
End If