Private Sub MSComm1_OnComm()
Dim Buffer As String
Dim t1 As Single
Buffer = MSComm1.CommEvent
t1 = timer
Do Until Buffer = 2
If timer - t1 > 2 Then Exit Sub
Loop
Call AddScanRecords
End Sub
I use the code whit barcode scanner...Idea is take a barcode from com-port buffer when all barcode is received and call subroutine. If reading is failed then Exit sub.
Is this a good way handle the buffer?
Dim Buffer As String
Dim t1 As Single
Buffer = MSComm1.CommEvent
t1 = timer
Do Until Buffer = 2
If timer - t1 > 2 Then Exit Sub
Loop
Call AddScanRecords
End Sub
I use the code whit barcode scanner...Idea is take a barcode from com-port buffer when all barcode is received and call subroutine. If reading is failed then Exit sub.
Is this a good way handle the buffer?