Hello all. My name is Hector Colon from Puerto Rico. Although I have no formal preparation as a programmer I been successful so far creating what was needed in my workplace. Now there is a show stopper for my last project. Using Vba for access I have a form that receives RF signals on the comport with onComm events and writes the values to the form text box. Now I need to write the same values to a remote computer textbox. both computers are on the same network just on different buildings. Please advice. Here the current code that does the work on the local form:
Private Sub MSComm1_OnComm()
Dim InBuffer As String, tbox As TextBox, tbox2 As TextBox
'This part of the code do the reading of the USB port and dump the data on the Text1 box when there is something on the
'buffer
InBuffer = MScomm1.InputData
If InBuffer <> "" Then
Text1.SetFocus
Text1.Text = InBuffer 'Display input data.
If Left(Text1, 1) = "T" Then
Set tbox = Me.Controls(Mid(Text1, 2, 2)) 'from second character take two characters to point to the line register
tbox.DefaultValue = FormatNumber((Mid(Text1, 4, 2)))
Set tbox = Me.Controls(Mid(Text1, 1, 3)) 'from first character take three characters to point to the register of the technician"
tbox.DefaultValue = ((Mid(Text1, 6, 4)))
End If
texttest.Value = Text1.Value
Text1.Value = ""
End If
End Sub
Private Sub MSComm1_OnComm()
Dim InBuffer As String, tbox As TextBox, tbox2 As TextBox
'This part of the code do the reading of the USB port and dump the data on the Text1 box when there is something on the
'buffer
InBuffer = MScomm1.InputData
If InBuffer <> "" Then
Text1.SetFocus
Text1.Text = InBuffer 'Display input data.
If Left(Text1, 1) = "T" Then
Set tbox = Me.Controls(Mid(Text1, 2, 2)) 'from second character take two characters to point to the line register
tbox.DefaultValue = FormatNumber((Mid(Text1, 4, 2)))
Set tbox = Me.Controls(Mid(Text1, 1, 3)) 'from first character take three characters to point to the register of the technician"
tbox.DefaultValue = ((Mid(Text1, 6, 4)))
End If
texttest.Value = Text1.Value
Text1.Value = ""
End If
End Sub