receive data from serial comm and display on VB 6.0 textbox

Thread Starter

bubblysush

Joined May 14, 2012
3
Hello allllll :D
PLZ PLZ PLZ help meeeeeeeee :(

m using a RFID module which i have programmed, m sending the data to the pc... m able to see the data in the hyperterminal of the system...
I want to see the same data on my VB 6.0 Form text box.... the data is not display.. this is the code
Private Sub MSComm1_OnComm()
Dim strInput As String
'test for incoming event
S
 

Attachments

Thread Starter

bubblysush

Joined May 14, 2012
3
sorry this is the code

Private Sub MSComm1_OnComm()
Dim strInput As String

'test for incoming event
Select Case .CommEvent
Case comEvReceive
'display incoming event data to displaying textbox
strInput = MSComm1.Input
text1.SelText = strInput
End Select

End Sub
 

ErnieM

Joined Apr 24, 2011
8,047
I don't use the Seltext property of a textbox, I use the Text property.
Rich (BB code):
Private Sub MSComm1_OnComm()

if .CommEvent = comEvReceive
    'display incoming event data to displaying textbox
     Text1.Text = MSComm1.Input
endif

End Sub
I may be missing some other things (like emptying the receive buffer) as I don't have VB6 anymore.

<sigh> I need to dig that CD up.
 

BMorse

Joined Sep 26, 2009
2,675
Rich (BB code):
Private Sub MSComm1_OnComm()  
if .CommEvent = comEvReceive     'display incoming event data to displaying textbox      
Text1.Text = Text1.text & MSComm1.Input 
endif  
End Sub
Try appending the incoming data to the textbox text instead of overwriting it with every character that you receive from the commport.....

and don't forget to set comm properties and open the commport first before you can receive any data.
 
Last edited:
Top