trying to fix a code ms access : here is my code I keep getting the same error compile error: block if without end if  

here is my code that I am working with
Private Sub Command1_Click()
If IsNull(Me.txtusername) Then
    'MsgBox "Please enter Username", vbInformation, "Username Required"
If IsNull(Me.txtpassword) Then
    'MsgBox "Please enter Password", vbInformation, "Password Required"
Else
    'processs the job
    If (IsNull(DLookup("[username]", "tbllogin info", "[username] ='" & Me.txtusername.Value & "' And password = '" & Me.txtpassword.Value & "'"))) Then
    MsgBox "login unsucessful"
End If
    'MsgBox "Login Succeddful"
    DoCmd.OpenForm "s-1 page"

End Sub
