Help with reports w/arrays
Steve 4
john 2
Mike 3
Now the file can have hundreds of records in any order, here is a few records;
Mike,10:08:20 AM,10:08:49 AM ,Repeat Customer,Bedroom,Financing TD,No,,5/25/2006
Steve,10:08:58 AM,10:09:03 AM ,Customer Refferal,Upholstery,Buying House,No,,5/25/2006
Steve,10:09:13 AM,10:09:20 AM ,Sign/Drive By,Recliner,Financing TD,No,,5/25/2006
John,10:09:14 AM,10:09:53 AM ,Sign/Drive By,Bedroom,Didn't Have Style,No,,5/25/2006
Steve,10:10:06 AM,10:10:49 AM ,TV Ad,Bedroom,Didn't Have Style,No,,5/25/2006
Steve,10:10:04 AM,10:10:52 AM ,TV Ad,Bedroom,Price,No,,5/25/2006
Mike,10:08:20 AM,10:08:49 AM ,Repeat Customer,Bedroom,Financing TD,No,,5/25/2006
Steve,10:08:58 AM,10:09:03 AM ,Customer Refferal,Upholstery,Buying House,No,,5/25/2006
Here is the code that Im working with:
Private Sub NameCount(sFIle As String)
Dim tmp() As String
Dim Lines() As String
Dim tName As String
Dim Found As Boolean
Lines = Split(sFIle, vbCrLf)
For x = 0 To UBound(Lines)
If Lines(x) <> "" Then
tmp = Split(Lines(x), ",")
tName = tmp(0)
Found = False
'----------------------
' Writing to listbox This part is looking to see if name is already
' on list if so add 1 to it
'----------------------
If List1.ListCount <> 0 Then
For i = 0 To List1.ListCount - 1
tmp = Split(List1.List(i), " ")
If tmp(0) = tName Then
List1.List(i) = tName & " " & CInt(tmp(1)) + 1
Found = True
Exit For
End If
Next
End If
If Not Found Then
List1.AddItem tName & " 1"
End If
End If
Next
'----------------------
End Sub
Private Sub Form_Load()
Dim sF As String
Open "C:\Program Files\Microsoft Visual Studio\VB98\data2.txt" For Input As #1
sF = Input(LOF(1), 1)
Close #1
NameCount sF
End Sub
Right now the code works perfect but the out is a listbox, I need it to the same thing but right to a file
Any suggestions would be helpfull Thanks

