I have figured that part out. Now I need to know why it shows my computers connection twice and all others only once. This happens from each computer you bring up the user list form.
How to Generate a User List
Collapse
X
-
-
I have a form called Frm_Con_Users. The above code is executed in the Form_Load event and the Form_Timer event. The function which I call List_Users contains the above code and is also in the forms code container (not sure if I referenced that correctly).Comment
-
From the front end. I want an "Administra tor" to see who is connected, while using the Front End Database. I had to do some tweaking to get this code to recognize my back end db connection.Comment
-
@Wesley:
I could not duplicate your Error. Download the Attachment which I know works, then compare it to your configuration.Attached FilesComment
-
Thank you for the code and your time! The only difference between your form and mine are the connection properties. I am running my form from the Front End DB and connecting to the Back End DB using:
Code:cnn.Open "Provider=Microsoft.ACE.OLEDB.12.0;" & _ "Data Source="
Again, Thank you for your time. I will live with the current results.Comment
-
@Wesley:
You are quite welcome. You could actually write Code, parsing strUser and eliminating the Duplicates, since it is nothing more than a Semi-Colon Delimited String. Actually, assuming the Recordset is mirroring this Duplication, we should only process the Odd Number Rows and build strUser accordingly. I'm assuming the Even Rows would represent the Duplicates, but only you can test this for sure. Modify the GenerateUserLis t() Function slightly (Lines 12 and 14).
Code:'*************************** Code Intentionally Omitted *************************** With rst 'fills Recordset (rst) with User List data Do Until .EOF intUser = intUser + 1 For Each fld In .Fields varValue = fld.Value 'Some of the return values are Null-Terminated Strings, if 'so strip them off If InStr(varValue, vbNullChar) > 0 Then varValue = Left(varValue, InStr(varValue, vbNullChar) - 1) End If If intUser Mod 2 <> 0 Then 'Process ODD Rows only strUser = strUser & ";" & varValue End If Next .MoveNext Loop End With '*************************** Code Intentionally Omitted ***************************
Comment
-
-
This is GREAT... Really appreciate sharing all this info. The code works great for me (am using the updated code with GetUserName and ID)except when I test it with another User and I open the User List Form I will see 2 users on but with an ID showing myself twice. When I have the other user load the User List Form he sees himself twice. Very Odd.... We are opening the form in the back end.
Thanks for any assistance..... ....Comment
Comment