Hello and first question. (1 Viewer)

hcolon

New member
Local time
Today, 03:36
Joined
May 10, 2021
Messages
1
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
 

Jon

Access World Site Owner
Staff member
Local time
Today, 08:36
Joined
Sep 28, 1999
Messages
7,383
Welcome to the forums! We are the most active Microsoft Access community on the internet by far, with posts going back over 20 years!

To get started, I highly recommend you read the post below. It contains important information for all new users to this forum.

https://www.access-programmers.co.uk/forums/threads/new-member-read-me-first.223250/

We look forward to having you around here, learning stuff and having fun!
 

theDBguy

I’m here to help
Staff member
Local time
Today, 00:36
Joined
Oct 29, 2018
Messages
21,455
Hi. Welcome to AWF!

You might consider posting your question in a regular forum. Cheers!
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 00:36
Joined
Aug 30, 2003
Messages
36,124
Welcome. I moved your thread to a more appropriate forum, so no need to repost it.
 
Last edited:

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 02:36
Joined
Feb 28, 2001
Messages
27,148
First, hello and welcome, Hector.

Second, here is the problem you face. Windows is written based on the original U.S. Federal Government's "Orange Book" C2 principles, one of which is inter-process isolation. Unless you have a massive pot load of Windows privileges, you can't affect another separate task/process even on your own system, much less on a remote system that involves network privileges. For security reasons, Windows will block this. Therefore, there is no easy code to "reach out and touch" the other process.

What would be better is that IF you have a common back-end (BE) that your system and that remote system share, you could pass the values to the shared BE and have the other system check every so often on a timer. We have actually had lots of threads on exactly this subject. The trick here is that you have set up something in which you EXPECT a "reach out and touch" situation. However, be aware that there is overhead involved in having a timer that does this sort of thing, and the more often you check, the worse the system load becomes.

If doing that on a timer is not good enough (fast enough?), then there IS such a thing as having a form sitting minimized in the background on that remote system and have some code running in that form establish a windows socket to your system and then wait for you to post a value. In that case, the remote minimized form can see the other form and post things in it since they would be part of the same task. The complexity of that task might be daunting to folks with limited programming experience. Heck, I know it would take me a while.
 

Users who are viewing this thread

Top Bottom