By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,827 Members | 2,220 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,827 IT Pros & Developers. It's quick & easy.

MSComm and datas receive

P: n/a
I have little problem when I get the data(bar code) from Com-port to
access 97. These looks like below: Why does a code will be sometime in
two recordfiel boxs??

This is the code what is in VBA.

Private Sub MSComm2_OnComm()

Dim buffer As String
Dim T1 As Single

buffer = MSComm2.CommEvent
T1 = Timer

Do Until buffer = 2
If Timer - T1 3 Then Exit Sub
Call AddScanRecords

End Sub

Sub AddScanRecords()

Dim db As Database, rs As DAO.Recordset
Dim StartTime As Date

StartTime = Now()

Set db = CurrentDb
Set rs = db.OpenRecordset("kone1")

rs![BarCode] = MSComm2.Input
rs![ScanDate] = Now()

End Sub

How I can do the buffer like

Can I do a buffer as receive data packet and CRLF. I am not sure what
is right way..


Data Packet Separator #1 is defined as CR (0DH) and Data Packet
Separator #2 is defined as LF (0AH).

Both separators will be sent together.


Jul 21 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.