ok heres the issue I'm attempting to read from a comma delimited file, the values are put into a structure (employeerecords) i want to know how i can access the separate sections of this structure i will provide my code so far, i apologize for the comments I'm making sure i know whats going on, I'm new to this, the code currently just dumps the whole file into a textbox, i would like to be able to access and manipulate the individual fields but i am at a genuine loss.
Thanks
Code:'structure for the array, the values are declared in the order they appear more below. Structure EmployeeRecords Dim surname As String 'as first field before comma is the surname Dim firstname As String 'as second field after surname is firstname Dim nationalininsurance As String 'etc. Dim taxcode As String Dim hoursworked As Integer Dim rateofpay As Integer End Structure Dim employeearray As EmployeeRecords ' stating that employeearray is now the structure employee records Dim currentline As String ' this is the name i have decided to give to the variable where the line which is taken from the file is stored 'to be later used to input said line into a text box Private Sub inputfile() FileOpen(1, "C:\Users\Alex\Documents\Visual Studio 2008\Employee Doc.txt", OpenMode.Input) Do While Not EOF(1) currentline = LineInput(1) TextBox1.Text = TextBox1.Text & currentline & vbNewLine Loop End Sub




Reply With Quote