Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Function GetCurrentUsers() As String
Dim cnn As ADODB.Connection
Dim rst As ADODB.Recordset
Dim strReturn As String
Set cnn = CurrentProject.Connection
Set rst = cnn.OpenSchema(adSchemaProviderSpecific, , _
"{947bb102-5d43-11d1-bdbf-00c04fb92675}")
With rst
While Not .EOF
strReturn = strReturn & _
NullTrim(.Fields("COMPUTER_NAME")) & ";" & _
NullTrim(.Fields("LOGIN_NAME")) & ";" & _
NullTrim(.Fields("CONNECTED")) & ";" & _
NullTrim(.Fields("SUSPECT_STATE")) & ";"
.MoveNext
Wend
End With
GetCurrentUsers = strReturn
End Function
Function NullTrim(ByVal vValue As Variant) As String
Dim lngIndex As Long
vValue = Trim(Nz(vValue, "(Null)"))
lngIndex = InStr(vValue, Chr(0))
If lngIndex > 0 Then
NullTrim = Left(vValue, lngIndex - 1)
Else
NullTrim = vValue
End If
End Function
Private Sub Form_Load()
With Me!lstUsers
.ColumnCount = 4
[green]'settings for a 5" wide listbox:[/green]
.ColumnWidths = "1.5"";1.5"";1"";1"""
[green]'turn on column headings:[/green]
.ColumnHeads = True
.RowSource = "ComputerName;Login;Connected?;Suspect?;" & GetCurrentUsers()
[green]'select the first row:[/green]
If .ListCount > 1 Then
.Selected(1) = True
End If
End With
End Sub
Private Sub Form_Load()
With Me!lstUsers
.ColumnCount = 4
[blue].RowSourceType = "Value List"[/blue]
[green]'settings for a 5" wide listbox:[/green]
.ColumnWidths = "1.5"";1.5"";1"";1"""
[green]'turn on column headings:[/green]
.ColumnHeads = True
.RowSource = "ComputerName;Login;Connected?;Suspect?;" & GetCurrentUsers()
[green]'select the first row:[/green]
If .ListCount > 1 Then
.Selected(1) = True
End If
End With
End Sub