All in one channel
All in one channel

Reputation: 23

Function call on left hand side of assignment must return Variant or object

Private Sub CommandButton1_Click()

If TextBox1 = Hayu And TextBox2 = 2007 Then

MsgBox = "login successful"

Me.Hide

Else

MsgBox = "incorrect creditanls"

End If

End Sub

Upvotes: 0

Views: 258

Answers (1)

Gary's Student
Gary's Student

Reputation: 96753

Does this work better:

Private Sub CommandButton1_Click()
    If TextBox1 = "Hayu" And TextBox2 = "2007" Then
        MsgBox "login successful"
        Me.Hide
    Else
        MsgBox "incorrect creditanls"
    End If
End Sub

Upvotes: 2

Related Questions