however I would rather load the .csv data from the Resource File.
I have already created the .res and loaded the .csv as resource 101.
I believe the code should look something like this...
Dim datafile As Long datafile = LoadResData(101, 10) ' data type is Custom. 10 is defined as [i]user defined[/i] Open datafile For Input As #1
...however I continue to get runtime error #326 Resource with identifier '101' not found. and my datafile value is 0.
I am a beginner, can you offer any help on what I'm missing?
Thanks in advance!
Private Sub Form_Load() Dim n As Integer ' add total number of problems - this lis to load my combo dropdown For n = 6 To 95 Step 1 ' Set up 95 repetitions. cmboNumOfProb.AddItem n Next n '___________________________________________________________________________________ 'The following code opens the Grader.csv file and loads a 2d Array. Dim a As String, ColumnNames() As String, arrayOfItemsForSingleRow() As String, columnNumber As Integer Open "C:\Personal\Software Solutions\vb\Grader.csv" For Input As #1 Line Input #1, a$ 'read the column names (first line in file) ColumnNames = Split(a$, ",") 'ubound(ColumnNames)+1 is now number of data fields per line Dim rowNumber As Integer rowNumber = 0 Form1.MousePointer = 11 While Not EOF(1) Line Input #1, a$ rowNumber = rowNumber + 1 arrayOfItemsForSingleRow = Split(a$, ",") 'Print eachItem(num) Debug.Print "Here is the row data..." 'the purpose of the following for-loop is to go through all the columns in this row 'and populate my 2-D array For columnNumber = 1 To UBound(arrayOfItemsForSingleRow) Debug.Print arrayOfItemsForSingleRow(columnNumber) Grader(rowNumber, columnNumber) = arrayOfItemsForSingleRow(columnNumber) Next 'once we're here, all the values have been assigned for THIS row. so, let's go to the next row..... 'Debug.Print a$ 'Print ColumnNames(1) Wend Form1.MousePointer = 0 Close #1 frmWelcome.Show frmWelcome.SetFocus 'This is the end of the Array loading code. '_____________________________________________________________________________________________ End Sub
This post has been edited by dsgf: 25 May 2007 - 06:35 PM