Hi im new and need some help if possible

Im using Microsoft visual basic and have encountered a problem the code is as follows:

Private Sub cmdlogin_Click()

Dim strUsername As String
Dim strPassword As String

Dim usr As Variant
Dim pwd As Variant

strUsername = txtusername.Text
strPassword = txtpassword.Text

usr = Application.VLookup(txtusername.Text, Range("Users"), 2, False)
pwd = Application.VLookup(txtpassword.Text, Range("Passwords"), 2, False)

If IsError(usr) = False Then
If Application.VLookup(txtusername.Text, Range("Users"), 2, 0) = _
txtpassword.Text Then
Sheets("Input").Select

MsgBox "Login Successful!"
Unload frmlogin

Else
Msg "Incorrect Password"
End If
End If

End Sub

When I leave visual basics back to excel to click on login
it jumps back to visual basic stating that an object is required.

I feel like its an easy fix?
However I needed to reach out before I rip my hair from my head.

thankyou guys.