
08-20-2003, 01:29 AM
|
|
Regular
|
|
Join Date: Jun 2003
Location: NZ
Posts: 50
|
|
Flexgrid anyone?
|
I am trying to loop through my data in a txtfile to add t to my flexgrid.
Can anyone suggest a method in the attached code on how to do it as an array so it will add a row and the data as long as there s data in the file?
I want it to add enough rows that it reaches EOF and then stop. The colum width is always the saem (5).
Can anyone help me? i'm a bit new to this, if anyone an edit my code i'd be so very appreciative
Cheers
B
-----------------------Code----------------------------------
Private Sub loadfields()
On Error GoTo Handler
'Dim variables as string
Dim Id As String
Dim Sitename As String
site = lblsitename.Caption
'Open site bankings file
Open App.Path & "\" & site & "\data\bankings.dat" For Input As #1
Do While Not EOF(1)
'reads the data from the file named "bankings.dat" as seen in the form load
Input #1, Id, Sitename
Close #1 'closes the file
msf1.Row = i
msf1.Col = 0
msf1.Text = "Date Banked"
msf1.Row = 1
msf1.Col = 0
msf1.Text = Id
msf1.Row = 0
msf1.Col = 1
msf1.Text = "Calculated"
msf1.Row = 0
msf1.Col = 2
msf1.Text = "Actual"
msf1.Row = 0
msf1.Col = 3
msf1.Text = "Statement Number"
msf1.Row = 0
msf1.Col = 4
msf1.Text = "Over / Under"
Loop
Close #1
Exit Sub
Handler:
LogError Err.number, Err.Description, Me.Name, "Loadfields"
End Sub
------------------------End Code------------------------------------
|
|