Thanks London , your code makes the trick, but i modified it to the following because I will make the error message as a "label" under Textboxes "username and password"
Here is the code I use now
Private Sub txtUsername_AfterUpdate()
Me.Form.Filter = "UserName = '*" & Me.txtUsername & "*'"...