I have a problem with this code, I get a "Compile error: can't find project or library." I am pretty sure I have all the libraries loaded. Can anyone help with this?
If this post looks familiar, it is. It was posted a year or so ago. It works good in the dbase it came with but the OK button will not work in my dbase. Cancel button works fine. I am running access 2000.
Thanks for your help.
Private Sub okButton_Click()
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
If IsNull(Me.usertxt) Then
MsgBox "Please enter a valid user name.", vbExclamation, "Error"
ElseIf IsNull(Me.passtxt) Then
MsgBox "Please enter a valid password.", vbExclamation, "Error"
rs.Open "SELECT * FROM tblUser WHERE(UserName = """ & Me.usertxt & """ AND Pass = """ & Me.passtxt & """)", _
CurrentProject.Connection, adOpenKeyset, adLockOptimistic
If rs.EOF Then
MsgBox "Invalid user name or password. Please try again.", vbExclamation, "Error"
MsgBox "Login Successful.", vbInformation, "Confirm!"