From this Sub, what would cause the form to close when I run this code? This code will run when I click on the "Submit" button on my application.

vb.net Code:
  1. Private Sub bSub_Clicker()
  2.  
  3.         Dim tempDir As String = dir.Text
  4.         Dim lastChar As String
  5.         Dim tempFile As String = file.Text
  6.         Dim response As MsgBoxResult
  7.         Dim checker As String = ""
  8.  
  9.         If System.IO.File.Exists(dir.Text & "\" & file.Text & ".txt") = False Then
  10.             lastChar = HWFunctions.getLast(dir.Text)
  11.             If lastChar = "\" Then
  12.                 response = MsgBox("The file " & tempDir & tempFile & ".txt does not exist." _
  13.                                   & vbCrLf & "Would you like it to be created for you?", 4)
  14.             End If
  15.             If lastChar <> "\" Then
  16.                 response = MsgBox("The file " & tempDir & "\" & tempFile & ".txt does not exist." _
  17.                                   & vbCrLf & "Would you like it to be created for you?", 4)
  18.             End If
  19.             If response = MsgBoxResult.Yes Then
  20.                 If System.IO.Directory.Exists(dir.Text) = False Then
  21.                     Try
  22.                         System.IO.Directory.CreateDirectory(dir.Text)
  23.                     Catch ex As ArgumentException
  24.                         MsgBox("Please input a directory name.")
  25.                         checker = "something"
  26.                     End Try
  27.                 End If
  28.                 If checker = "" Then
  29.                     lastChar = HWFunctions.getLast(dir.Text)
  30.                     Try
  31.                         If lastChar = "\" Then
  32.                             System.IO.File.Create(tempDir & tempFile & ".txt")
  33.                         ElseIf lastChar <> "\" Then
  34.                             System.IO.File.Create(tempDir & "\" & tempFile & ".txt")
  35.                         End If
  36.                     Catch ex As UnauthorizedAccessException
  37.                         MsgBox("Access to the current directory is denied.")
  38.                         checker = "something"
  39.                     End Try
  40.                     My.Settings.chosenDir = dir.Text
  41.                     My.Settings.chosenFileName = file.Text
  42.                 End If
  43.  
  44.             End If
  45.  
  46.             If response = MsgBoxResult.No Then
  47.                 MsgBox("Please choose another directory.")
  48.                 checker = "something"
  49.             End If
  50.         Else
  51.             My.Settings.chosenDir = dir.Text
  52.             My.Settings.chosenFileName = file.Text
  53.  
  54.             If hw.Visible = False Then
  55.                 hw.Show()
  56.             End If
  57.  
  58.             Me.Hide()
  59.         End If
  60.  
  61.  
  62.  
  63.         If checker = "" Then
  64.             If hw.Visible = False Then
  65.                 hw.Show()
  66.             End If
  67.  
  68.             Me.Hide()
  69.         End If
  70.  
  71.     End Sub
Thanks,

jerz4lunch