Being a complete novice to VB I'm trying to open a csv file a search for a number. The code is below but it fails at the file open. Could anyone help me to open this file and search it???
Thanks
Private Sub CFLaser1_BarCodeReceived(cstrBarCode As String, ByVal nCodeType As Integer)
Dim LnCount As Integer
Dim FoundLn As Integer
Dim flds As String
Dim sFle
txtBarCode.Text = cstrBarCode
MsgBox cstrBarCode, vbOKOnly, "R K B"
File.Open "test"
LineCount = 1
FoundLine = -1
Do While Not sFle.EOF
flds = Split(sFle.lineinputstring, ","
If flds(LBound(flds)) = cstrBarCode Then
MsgBox "RKB"
FoundLine = LineCount
Exit Do
End If
LineCount = LineCount + 1
Loop
File.Close
End Sub
Thanks
Private Sub CFLaser1_BarCodeReceived(cstrBarCode As String, ByVal nCodeType As Integer)
Dim LnCount As Integer
Dim FoundLn As Integer
Dim flds As String
Dim sFle
txtBarCode.Text = cstrBarCode
MsgBox cstrBarCode, vbOKOnly, "R K B"
File.Open "test"
LineCount = 1
FoundLine = -1
Do While Not sFle.EOF
flds = Split(sFle.lineinputstring, ","
If flds(LBound(flds)) = cstrBarCode Then
MsgBox "RKB"
FoundLine = LineCount
Exit Do
End If
LineCount = LineCount + 1
Loop
File.Close
End Sub