Here's the deal. I have some code which, to cut a long story short, reads some values from a barcode scanner into an array and compares them with values in a text file.
I have a problem in that if I get a mismatch I want to halt the process and allow the user to re-scan the barcode and compare it against the corresponding value in the text file.
To do this, I think I need to step back in the text file (comma delimited) to ensure that the correct value is being compared.
Here's the code I have, which works great if all values match. There is more to it but here's the bit I'm concentrating on..
VB Code:
Private Sub cmdCompare_Click() Dim arrX As Integer cmdCompare.Enabled = False If n = 0 Then n = 1 If n = 1 Then Open strinfile For Input As #1 End If For arrX = 0 To UBound(myArray) Input #1, LineIn If LineIn = myArray(arrX) Then With shpGreenLight(arrX) .Visible = True .BackColor = &HC000& .FillColor = &HC000& End With Else With shpGreenLight(arrX) .Visible = True .BackColor = &HFF& .FillColor = &HFF& End With 'need to do something here Exit Sub End If Next If n = intfileLen Then Close #1 End If doCheckCards End Sub
Any clues?!
Cheers




Reply With Quote