The rest of the code seems to be working, it's just the name part, but I've uploaded the full code just in case there was an error I missed.
In case it makes any difference, I'm using Microsoft Visual Basic 2010 Express.
Option Explicit On Option Strict On Option Infer Off Public Class MainForm Private Sub nameTextBox_Enter(ByVal sender As Object, ByVal e As System.EventArgs) Handles nameTextBox.Enter ' select the existing text nameTextBox.SelectAll() End Sub Private Sub fileExitMenuItem_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles fileExitMenuItem.Click Me.Close() End Sub Private Sub filePrintMenuItem_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles filePrintMenuItem.Click PrintForm1.PrintAction = Printing.PrintAction.PrintToPreview PrintForm1.Print() End Sub Private Sub addButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles addButton.Click Dim fullName As String Dim firstName As String Dim middleName As String Dim lastName As String Dim index As Integer fullName = nameTextBox.Text.Trim If fullName = String.Empty Then MessageBox.Show("Please enter a name", "Bucky Burgers", MessageBoxButtons.OK, MessageBoxIcon.Information) Else index = fullName.IndexOf(" ") If index > -1 Then firstName = fullName.Substring(0, index) middleName = fullName.Substring(index + 1) lastName = fullName.Substring(index + 2) firstName = firstName.Substring(0, 1).ToUpper & firstName.Substring(1).ToLower middleName = middleName.Substring(0, 1).ToUpper & middleName.Substring(1).ToLower lastName = lastName.Substring(0, 1).ToUpper & lastName.Substring(1).ToLower fullName = firstName & " " & middleName & " " & lastName Else fullName = fullName.Substring(0, 1).ToUpper & fullName.Substring(1).ToLower End If namesListBox.Items.Add(fullName) End If nameTextBox.Focus() nameTextBox.SelectAll() End Sub End Class