Good day!
I have a form named ShowDatabaseUsers that contains the following.
List Box:
lstCompName
lstEmpName
Button
cmdClose
In the "On Open" event of the form I have code that populates lstCompName with the names of users computers that are currently using the database. The code looks like this:
I also have a table with employee names and computer numbers. The table looks like this
Table (Employees):
Employee
compID
My question is this. How would I go about populating lstEmpName with the Employee name pulled from the Employees table?
________________________________________
Buddha. Dharma. Sangha.
I have a form named ShowDatabaseUsers that contains the following.
List Box:
lstCompName
lstEmpName
Button
cmdClose
In the "On Open" event of the form I have code that populates lstCompName with the names of users computers that are currently using the database. The code looks like this:
Code:
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
cn.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=G:\xxx\QualityControl.mdb;Jet OLEDB:Database Password=somePassword"
cn.Properties("Jet OLEDB:Connection Control") = 1
Set rs = cn.OpenSchema(adSchemaProviderSpecific, , _
"{947bb102-5d43-11d1-bdbf-00c04fb92675}")
'Output the list of all users in the current database.
Do While Not rs.EOF
lstCompName.AddItem rs.Fields(0)
rs.MoveNext
Loop
cn.Close
I also have a table with employee names and computer numbers. The table looks like this
Table (Employees):
Employee
compID
My question is this. How would I go about populating lstEmpName with the Employee name pulled from the Employees table?
________________________________________
