If Trim(txtStudentName.Text) = vbNullString Then MsgBox "Please enter student name" End If Exit Sub