I am stuck. I am trying to export text from form to a csv file.

Below is a part of the code I am working on, but I am now quite lost.

Thanks for any help you can give me.


Public Class Form1
Public names(103, 1) As String

Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboNameList.SelectedIndexChanged

For i = 0 To 103

If cboNameList.Text = names(i, 0) Then
lblDfE.Text = names(i, 1)
End If

Next i
lblRef.Text = "ACC-" + lblDfE.Text + "-" + lblToday.Text + "-" + lblYourRef.Text

End Sub

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
lblToday.Text = Format(Now, "dd-MM-yy")

SchoolListArray() 'initialise the array

End Sub
Private Sub btnExport_Click(sender As Object, e As EventArgs) Handles btnExport.Click
'I've put the data I want to export in a list box as follows

End Sub