The commevent value will be 2 if it is receiving data.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/comm98/html/vbproComVbevt_Comm.asphttp://www.yes-tele.com/mscomm.html>But what if commevent <> 2? How will my form's property collect .input?
>Data all the same in all 22 rows.
>>Mark,
>>
>>Try this:
>>
>>WITH THIS
>> IF .commevent = 2
>> .pcLastReading = .pcLastReading + .INPUT
>> *!* Upate reading with the raw scan
>>TEXT TO lcSql TEXTMERGE NOSHOW
>>usp_UpdateReading '<<.pcLastReading>>', <.Parent.pnCommPort>>
>>ENDTEXT
>> THISFORM.mExecuteSqlCommand(lcSql, '', '')
>> ENDIF
>>ENDWITH
>>
>>
>>Also, what do the rows look like, datawise? Repetitive? Garbage?
>>
>>>I have the following code in the ONCOMM event of the control:
>>>WITH This
>>> .pcLastReading = .pcLastReading + .Input
>>> *!* Upate reading with the raw scan
>>> TEXT TO lcSql TEXTMERGE NOSHOW
>>> usp_UpdateReading '<<.pcLastReading>>', <.Parent.pnCommPort>>
>>> ENDTEXT
>>> ThisForm.mExecuteSqlCommand(lcSql, '', '')
>>>ENDWITH
>>>
>>>I am getting about 22 rows inserted into an SQL table after a single scanner's scan that is attached to the comm port. Why that's happening? My barcode is short - 5 chars.
.·*´¨)
.·`TCH
(..·*
010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"