Put this function in the standard module and put the global up in the declarations area of the module.
'-- A LINK to check out that explains the function
Option Explicit
Global Const JET_SCHEMA_USERROSTER = _
"{947bb102-5d43-11d1-bdbf-00c04fb92675}"
Function ADOUserRoster()
Dim cnn As New ADODB.Connection
Dim rst As ADODB.Recordset
' Open the connection
' cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
' "Data Source=.\NorthWind.mdb;"
cnn.Open CurrentProject.Connection
' Open the user roster schema rowset
Set rst = cnn.OpenSchema(adSchemaProviderSpecific, , _
JET_SCHEMA_USERROSTER)
' Print the results to the debug window
' to check who is logged on.
Debug.Print rst.GetString
Dim cnt As Integer, indx As Integer
cnt = 0
rst.MoveFirst
For indx = 0 To 2000
If Not rst.EOF Then
cnt = cnt + 1
Else
Exit For
End If
rst.MoveNext
Next '- end for
Debug.Print "count of connections = "; cnt
cnn.Close
End Function