By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,484 Members | 1,811 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,484 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??

http://students.oamk.fi/~rajata01/example.JPG

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
Loop
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.AddNew
rs![BarCode] = MSComm2.Input
rs![ScanDate] = Now()
rs.Update

rs.Close
db.Close
End Sub

How I can do the buffer like
this...http://msdn.microsoft.com/library/de...vbobjcommx.asp

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

Example

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.

.... <DATA PACKET #1<CRLF<DATA PACKET #2<CRLFetc

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.