0
Private Sub CommandButton1_Click() If TextBox1 = Hayu And TextBox2 = 2007 Then MsgBox = "login successful" Me.Hide Else MsgBox = "incorrect creditanls" End If End Sub 
2
  • You want to call the function MsgBox so remove the =, you cannot assign something to a function: MsgBox "login successful" Commented Aug 21, 2020 at 12:09
  • Have you edited both calls to MsgBox? Commented Aug 21, 2020 at 12:11

1 Answer 1

2

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 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.