When I run my program and select button8 i get:
An error occurred creating the form. See Exception.InnerException for details. The error is: Object reference not set to an instance of an object.
My code is as simple as -
Private Sub Button8_Click(sender As Object, e As EventArgs) Handles Button8.Click
frequency.Show()
Me.Close()
End Sub
The error is on the frequency.Show()
but i don't know how to fix it as all it does is open another form. I have run a check for errors and exceptions but nothing shows until I run it.
EDIT - added frequency.Load
code from comments.
Dim LineOfText
Dim aryTextFile() As String
Dim Line As String
Using SR As New IO.StreamReader("...\mainmenu.txt")
Do While Not SR.EndOfStream
'________________
LineOfText = My.Computer.FileSystem.ReadAllText("...\mainmenu.txt")
aryTextFile = LineOfText.Split(",")
For i = 0 To UBound(aryTextFile)
'MsgBox(aryTextFile(i))
Next i
' Read the file just created
Line = SR.ReadLine
TextBox1.Text = aryTextFile(0)
TextBox2.Text = aryTextFile(1)
TextBox3.Text = aryTextFile(2)
TextBox4.Text = Today
TextBox5.Text = aryTextFile(4)
Loop
End Using