-
Apr 2nd, 2014, 04:34 PM
#1
Thread Starter
New Member
List Box Error - Please Help!
Hello,
I am doing a project and I have created records to store students.
I know that these records are storing because I used them for a log in system. However I am having difficulty displaying them.
Here is the code I have used to display them in the code for the 'display' button:
Dim Index As Integer 'declares index as integer
Dim StudentRecord As StudentDetails 'one record
Filename = "StudentDetails" 'here is where the user chooses the test
FileOpen(1, Filename, OpenMode.Random, , , Len(StudentRecord)) 'opens records
NumberOfRecords = LOF(1) / Len(StudentRecord)
For Index = 1 To NumberOfRecords
FileGet(1, StudentRecord) 'gets the correct file
ListBoxSearchStudent.Items.Add(String.Format(MyFormat, StudentRecord.StudentUsername, StudentRecord.StudentPassword)) 'displays records
ListBoxSearchStudent.Items.Add(" ")
Next Index
FileClose(1) 'closes the file
However I am getting the error message 'Index (zero based) must be greater than or equal to zero and less than the size of the argument list.'.
Please help!
-
Apr 3rd, 2014, 01:49 PM
#2
Re: List Box Error - Please Help!
Welcome to VBForums
Thread moved from the 'General Developer' forum to the 'VB.Net' (VB2002 and later) forum
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|