I need to implement or add a sleep sub routine in Ms Access between the commwrite & commread so that I'm sure that all the data received from the gadget is read and received into my database. Now below is my draft sub routine see how to improve it. The gadget writes all the invoices without problems see attached screen, the only issue here is receiving that why the suggestion for a sleep sub:
Dim strData as stringDim strDataComplete as string strDataComplete = "" Do While True ' Loop until serial port is read Sleep 1000 lngStatus = CommRead(intPortID, strData, 100000) 'For 100000 is the max data length you want read, change to suite Sleep 1000 If lngStatus = 0 Then 'Keep polling to see if serial has data ElseIf lngStatus <> 0 Then strDataComplete = strData 'Put data pulled from serial port here End If If lngStatus = 0 And strDataComplete <> "" Then Exit Do ' Exit loop when all data is read End If Loop