VERSION 5.00 Begin VB.Form Form1 BorderStyle = 1 'Fixed Single Caption = " IF statment" ClientHeight = 1170 ClientLeft = 45 ClientTop = 435 ClientWidth = 3300 LinkTopic = "Form1" MaxButton = 0 'False ScaleHeight = 1170 ScaleWidth = 3300 StartUpPosition = 3 'Windows Default Begin VB.CommandButton cmdabout Caption = "&About" Height = 495 Left = 1800 TabIndex = 2 Top = 600 Width = 1335 End Begin VB.CommandButton cmdtest Caption = "&Test" Height = 495 Left = 120 TabIndex = 1 Top = 600 Width = 1335 End Begin VB.TextBox txtuser Height = 375 Left = 0 TabIndex = 0 Top = 120 Width = 3255 End End Attribute VB_Name = "Form1" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Option Explicit Private Sub cmdtest_Click() If txtuser.Text = "yes" Then MsgBox "You entered `yes`" ElseIf txtuser.Text = "no" Then MsgBox "You entered `no`" ElseIf txtuser.Text <> "yes" And txtuser.Text <> "no" Then MsgBox "You didnt enter `yes` or `no`" End If End Sub