Need your help on two things
How do i state at the end of this VBA to Close if every is True.
It currently stays open.
Private Sub Command1_Click()
If IsNull(Me.txtLoginID) Then
MsgBox "Please enter LoginID", vbInformation, "LoginID Required"
Me.txtLoginID.SetFocus
ElseIf IsNull(Me.txtPassword) Then
MsgBox "Please enter Password", vbInformation, "Password Required"
Me.txtPassword.SetFocus
Else
'process the job
If (IsNull(DLookup("[UserLogin]", "tblUser", "[Userlogin]='" & Me.txtLoginID.Value & "'"))) Or _
(IsNull(DLookup("Password", "tblUser", "Password='" & Me.txtPassword.Value & "'"))) Then
MsgBox "Incorrect LoginID or Password"
Else
'MsgBox "LoginID and Password correct"
DoCmd.OpenForm "Navigation form"
End If
End If
End Sub