Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Providing a running total on all machines

Posted on 2000-02-28
6
Medium Priority
?
130 Views
Last Modified: 2010-05-02
I've got 10 PC on a LAN that do wordprocessing in a VB program I wrote.
For reasons I can't go into there must be a running total of the amount of ENTER keystrokes displayed in a Label Control on all of the machines.
Eg. : PC1 presses ENTER - on all of the machines the running total goes up by one. Obviuosly the running total on all the machine must be the same.
How do I accomplish this?
0
Comment
Question by:Heinrichsa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 13

Expert Comment

by:crazyman
ID: 2564111
You could simply send out a UDP message when the enter key is pressed to all the machines on a specific port to tell them to increment there counter/or just tell them the complete new value that way they will always match.
0
 
LVL 13

Accepted Solution

by:
crazyman earned 600 total points
ID: 2564126
Something like this...

where text1 is the box for trapping key press and lblreturnpresses is the label.



Option Explicit

Private Sub Form_Load()
    Winsock1.Protocol = sckUDPProtocol
    Winsock1.Bind 12345
    lblreturnpresses.Caption = 0
End Sub

Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = 13 Then
        With Winsock1
            .RemotePort = 12345
            .RemoteHost = "255.255.255.255"
            .SendData CStr(CInt(lblreturnpresses) + 1)
        End With
    End If
End Sub

Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
    Dim strData As String
    Winsock1.GetData strData
    lblreturnpresses = strData
End Sub
0
 
LVL 1

Expert Comment

by:rskathait
ID: 2564486
Can you tell me what is your application architecture.....
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 2

Expert Comment

by:danlevans
ID: 2566478
Heinrichsa,

Bind all of your applications to a control database table. Update a count field each time the enter key is pressed. Display the count field on all PC's refreshing it with the timer.

Have Fun

Dan

0
 

Author Comment

by:Heinrichsa
ID: 2567740
danlevans,

I would not like to use a database because of the recordlocking that occurs. I know I can use the batch updating of ADO, but even with that it is not so effiecient with high hit rate.

I think crazyman has hit the nail on the head thanks for everyones comments
0
 
LVL 13

Expert Comment

by:crazyman
ID: 2576882
Thanks for the points,glad i could help
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question