Private Sub cmdok_Click() Static y As Integer Adodc1.Refresh With Adodc1.Recordset If .RecordCount > 0 Then If .EOF = False Then .MoveFirst If !UserName = txtUsername And !Password = txtPassword Then MsgBox "Login Successful!" frmMenu.Show Unload Me Else MsgBox "Invalid username/password!", vbOKOnly + vbCritical, "Access denied!" txtUsername.Text = "" txtPassword.Text = "" txtUsername.SetFocus End If End If End If End With End Sub
somebody please help me fix these code.. my username and password are saved on MS Access...the problem is that this code only accepts the 1st username and password stored on Access, if I try to login with the 2nd username and password stored on Access, it displays the msgbox stating "Invalid username/password!"...need immediate help! thanks in advance!