I had a great time reading data from a serial port and then placing it into an Access table. However the data that comes across from the MSComm1.Input is sometimes to long. Is there anyway to allow only 49 characters in at a time? AND THEN CLEAR THE BUFFER?
Here is what my code looks like:
Private Sub Receive_Click()
Dim Db As Database
Dim rs As Variant
Text1.Text = MSComm1.Input
Set Db = Workspaces(0).OpenDatabase("C:\Program Files\Microsoft Visual Basic\serial")
Set rs = Db.OpenRecordset("tbl_main", dbOpenDynaset)
rs("fld_String") = Text1.Text
rs.Update ' Save changes.
rs.Move 0, rs.LastModified ' Go to new record
rs.Close ' Close Table.
Db.Close ' Close Database