Can you send users a message at will?

kbrooks

Still learning
Local time
Today, 15:55
Joined
May 15, 2001
Messages
202
Kind of like a text message that will pop up over whatever they're working on at the time?

I have tried on 2 different occassions to split my database into fe/be and because of networking/security issues, there are always problems. So since there were only 4 users, I just said to heck with it and left it alone. The only problem is when I want to change the layout of a form, etc, I have to have them exit the database. I'm just trying to save myself 4 phone calls, I guess.
 
I was trying to do something very similar, and ended up using the Shell command in VBA.

The following post here should help.

Matt.
 
The coding is a little over my head, but thank you for the link! I'll print it out and shuffle through it this afternoon.
 
Hi MattS -

That shell command would be very handy for an app I'm working on but I don't have the slightest idea how to get the machine ID - do you know somewhere I can look to find out how to get this info?

Thanks -
Kev
 
How do you know if they are actually using the db? They might have it open
but have another Windows program active on their screen.

Are you use Windows XP or NT? If so, you can send instant messages that
will popup on their PC [no matter what they are doing]. Check the forum for
this has been discussed before.

This will work for a single message to a single user...

Call Shell("C:\WINDOWS\system32\net.exe send COMPUTERNAME Get out of the db now!", vbNormalNoFocus)

Of course you will need to know each person's computer name. This code will
do that for you [it must be run from their PC]
Code:
Option Compare Database
Option Explicit
    
Private Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long
    
Public Function ComputerName()
On Error GoTo Err_ComputerName

    Dim Comp_Name_B As String * 255
    Dim Comp_Name As String

    GetComputerName Comp_Name_B, Len(Comp_Name_B)
    Comp_Name = Left(Comp_Name_B, InStr(Comp_Name_B, Chr(0)) - 1)
    If Comp_Name = "" Then Comp_Name = " "
    ComputerName = Comp_Name

'    MsgBox "Computer name = " & ComputerName 'testing

Exit_ComputerName:
    Exit Function

Err_ComputerName:
    MsgBox Err.Number, Err.Description
    Resume Exit_ComputerName

End Function
HTH
 
Last edited:
Sometimes the easiest way to do this requires a little work ahead of time. In my case, the work had already been done so I just took advantage of it. In this case, it was a Startup form that gave me my opportunity to send messages to my users.

Most of my users are on machines that are pretty powerful. Like, any box less than 400 MHz was retired some time ago. So I have a startup form that I never actually close. In fact, you CAN'T close it. The button you click to get rid of the startup form merely minimizes and hides it.

Since that form is ALWAYS open and the boxes are usually very powerful, I can run some timer code underneath it in the class module. So once per minute my OnTimer code checks for an entry in a table that has a time-of-day associated with it. The table has a start time and an end time. If you are already in the database or trying right now to get into it during the gap between the starting and ending times for a particular "event" record, you get the message associated with that record. That message says, in brief, "Go Away, I'm doing xxxxxxxx at this time. I'll be done by hh:mm"

Then you publish a schedule that says "Although I won't do it every day, some days I will need exclusive use of the database to do certain maintenance things." Then, when you need the system, put a new "event" message in a table that your startup form can read. It is up to you as to whether you actually kick out users who aren't YOU at the moment. I didn't kick out users because I can trust my users enough to keep out of my way. (They know I COULD make their machines eat crud and die from inside Access anyway, so they sort of don't dare cross me.)

The key is to limit YOURSELF to this schedule. Save up stuff to do. Don't put useless down-time into the database if you don't need it. And ONLY use the down times that are pre-approved. If you have to get your boss's approval, you will probably get better results because your boss will like the idea of predictability for this down time.
 

Users who are viewing this thread

Back
Top Bottom