See what user is looking at in real-time

ColinEssex

Old registered user
Local time
Today, 15:56
Joined
Feb 22, 2002
Messages
9,314
Hi All,

I've done a search for this but can't quite find what I'm thinking of, so I just wondered if anyone may know.

Is it possible to see what form is being viewed / used by a user as at now in real-time? Its a bit like the "who's online" of this forum which shows what thread the user is looking at.

I've got Ghudsons excellent audit trail and a transaction log all working ok - I guess this is just an extension of this but can't quite get my head round it. It sounds like the Screen.ActiveForm property but I'm not sure.

I know who's logged in and that is shown on the switchboard screen with a refresh on the timer - I just don't know what form they have on their screen.

Is it possible?
 
This may seem a bit of a primitive solution, but have you considered a user table which has a column per form, and when a user opens/closes a form then their respective record field is updated to "open" or "closed" or whatever?
 
Thanks Jonno - I'll have a think on that, I've not considered it that way

Col
 
Colin, if you have a table for storing who's in and who's out of the database then I'm guessing you have a structure similar to this:

tblUsers
UserID
Forename
Surname
SystemCode
LoggedIn
CurrentForm


Where SystemCode is the username returned by the GetUserName function, LoggedIn is the time they logged into the database at, and CurrentForm is a Text field for storing the name of the form they are on.

In the Open event of each form a simple bit of SQL can do what you want:

Code:
Dim strSQL As String
strSQL = "UPDATE tblUsers SET CurrentForm = """ & Me.Name & """ WHERE SystemCode = """ & GetUserName() & """"
DoCmd.SetWarnings False
DoCmd.RunSQL strSQL
DoCmd.SetWarnings True
strSQL = vbNullString

Or the Execute method to run the SQL.
 
Thank you Mile-O, I do indeed have a table like that so I shall make the necessary amendments to things.

Col
 
There is actually software available that allows you to actually view another PC display and take over their mouse and keyboard. Cannot think of the name at the moment. Talk to your support/systems people.

I will try to remember the name

len
 
Thanks Len - our teckies use it.

I was just wanting to "spy" on what the users are doing in my database when they're logged in for ages and nothing gets logged in the transaction table.

Col
 
strSQL = vbNullString

Mile - is setting a string to null a common practice (i.e. did I miss something :D )... Can't say I've seen a lot of code that the string is set to null at the end - definitely do this with recordsets but haven't really seen it with strings... Is there a resource benefit with this or just a personal thing?

Thanks,
Kev
 
Kevin_S said:
Mile - is setting a string to null a common practice (i.e. did I miss something :D )

Is there a resource benefit with this or just a personal thing?

It is a personal thing but, at the same time, it most likely is a resource benefit although I can't say for sure.

When you dimension a string, the space is set up for it and, as strings can up to 2 billions characters in length, I prefer to set it back to a Null string when I'm finished with it. Each character in a string takes up 1 byte and, if the procedure/function ends without being set to null I can't help but think that the space isn't reclaimed from the memory - like when you don't set an object to Nothing once finished with it. With other data types there's no point in setting them to 0, for example, as the data type is a fixed length.

Maybe I'm cautious or maybe I'm right. Maybe somebody else may offer a confirmation? :cool:
 
I'd be interested in knowing what others think on this too... seems as your logic on this would be right (gonna have to start doing this myself)... love to hear some other opinions...

Kev
 
Could just make the users actions update a log file or table.. then you would be able to see whose doing what when, less of a neato solution but it will get the job done.
 

Users who are viewing this thread

Back
Top Bottom