Suppose you have the user name in txtusername.text and password in txtpassword.text
So on the OK/Login Button click event, check the following
Dim rsLogin AS New ADODB.RecordSet
Set rsLogin = New ADODB.RecordSet
if (txtusername.text <> "") And (txtpassword <> "") Then
rsLogin.Open "SELECT * FROM Login WHERE Uname = '" & txtusername.text & "' AND password = '" & txtpassword.Text & "'"
Endif
if rsLogin.EOF = True then
msgbox "Invalid UserName Or Password", VbCritical
txtusername.SetFocus
Else
msgbox "Successful Login"
Endif
Hope This Will Help You To Solve Your Problem