Showing active users in your database. (2024)

Results 1 to 7 of 7

  • Thread Tools
    • Show Printable Version
  1. 04-18-2017,02:19 PM #1

    Forbes

    • View Profile
    • View Forum Posts

    Showing active users in your database. (2)Competent Performer

    Showing active users in your database. (3) Windows 10 Showing active users in your database. (4) Access 2016

    Showing active users in your database. (5)

    Showing active users in your database. (6)

    Join Date
    Mar 2017
    Posts
    133
    How can I print the results from this 4 into a text box

    Code:

    Sub ShowUserRosterMultipleUsers() Dim cn As Object ' ADODB.ConnectionDim rs As Object ' ADODB.Recordset Const adSchemaProviderSpecific As Long = -1 Set cn = CreateObject("ADODB.Connection") cn.Provider = "Microsoft.ACE.OLEDB.12.0" cn.Open "Data Source=C:\Users\admin\Desktop\Reports.accdb" Set rs = cn.OpenSchema(adSchemaProviderSpecific, _ , "{947bb102-5d43-11d1-bdbf-00c04fb92675}") ' Output the list of all users in the current database. Debug.Print rs.Fields(0).Name, "", rs.Fields(1).Name, _ "", rs.Fields(2).Name, rs.Fields(3).Name Do While Not rs.EOF Debug.Print rs.Fields(0), rs.Fields(1), _ rs.Fields(2), rs.Fields(3) rs.MoveNext Loop End Sub
    Last edited by Forbes; 04-18-2017 at 07:54 PM.

    Reply With Quote

  2. 04-19-2017,01:21 AM #2

    June7

    • View Profile
    • View Forum Posts

    Showing active users in your database. (9)VIP

    Showing active users in your database. (10) Windows 7 64bit Showing active users in your database. (11) Access 2010 32bit

    Showing active users in your database. (12)Showing active users in your database. (13)Showing active users in your database. (14)Showing active users in your database. (15)Showing active users in your database. (16)Showing active users in your database. (17)Showing active users in your database. (18)Showing active users in your database. (19)Showing active users in your database. (20)Showing active users in your database. (21)Showing active users in your database. (22)

    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,156
    Maybe like:

    Code:

    Do While Not rs.EOF Me.tbxNames = Me.tbxNames & rs.Fields(0) & ", " & rs.Fields(1) & ", " & rs.Fields(2) & ", " & rs.Fields(3) & vbCrLf rs.MoveNextLoop

    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. 04-19-2017,08:07 AM #3

    Forbes

    • View Profile
    • View Forum Posts

    Showing active users in your database. (25)Competent Performer

    Showing active users in your database. (26) Windows 10 Showing active users in your database. (27) Access 2016

    Showing active users in your database. (28)

    Showing active users in your database. (29)

    Join Date
    Mar 2017
    Posts
    133
    Pretty nifty, although the only field that shows is the Computer Name Header and I get a debug error of Object required. pointing to your line?

    Reply With Quote

  4. 04-19-2017,12:17 PM #4

    Micron

    • View Profile
    • View Forum Posts

    Showing active users in your database. (31)Very Inert Person

    Showing active users in your database. (32) Windows 7 32bit Showing active users in your database. (33) Access 2007

    Showing active users in your database. (34)Showing active users in your database. (35)Showing active users in your database. (36)Showing active users in your database. (37)Showing active users in your database. (38)Showing active users in your database. (39)Showing active users in your database. (40)Showing active users in your database. (41)Showing active users in your database. (42)Showing active users in your database. (43)Showing active users in your database. (44)

    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,089
    Likely you copied the example verbatim and don't have a control called tbxNames?
    You should post what you tried or else we're just guessing.

    Reply With Quote

  5. 04-19-2017,01:24 PM #5

    Forbes

    • View Profile
    • View Forum Posts

    Showing active users in your database. (47)Competent Performer

    Showing active users in your database. (48) Windows 10 Showing active users in your database. (49) Access 2016

    Showing active users in your database. (50)

    Showing active users in your database. (51)

    Join Date
    Mar 2017
    Posts
    133

    Code:

    Sub ShowUserRosterMultipleUsers() Dim cn As Object ' ADODB.ConnectionDim rs As Object ' ADODB.Recordset Const adSchemaProviderSpecific As Long = -1 Set cn = CreateObject("ADODB.Connection") cn.Provider = "Microsoft.ACE.OLEDB.12.0" cn.Open "Data Source=C:\Users\admin\Desktop\Reports.accdb" Set rs = cn.OpenSchema(adSchemaProviderSpecific, _ , "{947bb102-5d43-11d1-bdbf-00c04fb92675}") ' Output the list of all users in the current database. Forms!frmadmin!txtuserslive = rs.Fields(0).Name frmadmin.txtuserslive = frmadmin.txtuserslive & rs.Fields(0).Name & ", " & rs.Fields(1).Name & ", " & rs.Fields(2).Name & ", " & rs.Fields(3).Name & vbCrLf Do While Not rs.EOFfrmadmin.txtuserslive = frmadmin.txtuserslive & rs.Fields(0) & ", " & rs.Fields(1) & ", " & rs.Fields(2) & ", " & rs.Fields(3) & vbCrLf rs.MoveNext Loop End Sub

    Reply With Quote

  6. 04-19-2017,01:33 PM #6

    June7

    • View Profile
    • View Forum Posts

    Showing active users in your database. (54)VIP

    Showing active users in your database. (55) Windows 7 64bit Showing active users in your database. (56) Access 2010 32bit

    Showing active users in your database. (57)Showing active users in your database. (58)Showing active users in your database. (59)Showing active users in your database. (60)Showing active users in your database. (61)Showing active users in your database. (62)Showing active users in your database. (63)Showing active users in your database. (64)Showing active users in your database. (65)Showing active users in your database. (66)Showing active users in your database. (67)

    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,156
    Maybe prefix with the Forms collection qualifier.

    Forms!frmadmin.txtuserslive = Forms!frmadmin.txtuserslive ...

    or if the code is behind the form, use the Me alias as in my example

    or could use a string variable in place of the textbox in the loop and then outside the loop set the textbox to the variable. See if that makes a difference. If same error then the issue is with the recordset object.

    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

    Reply With Quote

  7. 04-19-2017,01:52 PM #7

    Forbes

    • View Profile
    • View Forum Posts

    Showing active users in your database. (70)Competent Performer

    Showing active users in your database. (71) Windows 10 Showing active users in your database. (72) Access 2016

    Showing active users in your database. (73)

    Showing active users in your database. (74)

    Join Date
    Mar 2017
    Posts
    133
    Hey June7,

    Thank you for your input, using the "Forms!" Prefix ended up displaying the desired result. I have the call attached to a command button and when I run it I now see the information I want however the computer name shows but the login name and connected state will not show until I click inside the text box which is weird? But thank you so much!

    Reply With Quote

«Previous Thread|Next Thread»

Similar Threads

  1. Email picture not showing for remote users

    By trevor40 in forum Programming

    Replies: 2

    Last Post: 08-12-2016, 01:02 AM

  2. Building a database a table thats showing active records day by day.

    By medusa3604 in forum Database Design

    Replies: 2

    Last Post: 11-12-2015, 02:36 AM

  3. Visio Viewer Active X control not showing drawing in report

    By Rumpelstiltskin in forum Reports

    Replies: 12

    Last Post: 10-01-2014, 08:17 PM

  4. Showing active users in your database. (77)List of all users from active directory

    By bignate in forum Programming

    Replies: 3

    Last Post: 10-11-2013, 05:53 AM

  5. By royarellano in forum Access

    Replies: 0

    Last Post: 12-08-2011, 02:32 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  • BB code is On
  • Smilies are On
  • [IMG] code is On
  • [VIDEO] code is On
  • HTML code is Off

Forum Rules

  • Contact Us
  • Microsoft Access Forums
  • Privacy Statement
  • Top

All times are GMT -6. The time now is 07:14 AM.

Powered by vBulletin® Version 4.2.5
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.

AccessForums.net is not affiliated with Microsoft

Showing active users in your database. (2024)
Top Articles
Latest Posts
Recommended Articles
Article information

Author: Kelle Weber

Last Updated:

Views: 5316

Rating: 4.2 / 5 (53 voted)

Reviews: 84% of readers found this page helpful

Author information

Name: Kelle Weber

Birthday: 2000-08-05

Address: 6796 Juan Square, Markfort, MN 58988

Phone: +8215934114615

Job: Hospitality Director

Hobby: tabletop games, Foreign language learning, Leather crafting, Horseback riding, Swimming, Knapping, Handball

Introduction: My name is Kelle Weber, I am a magnificent, enchanting, fair, joyous, light, determined, joyous person who loves writing and wants to share my knowledge and understanding with you.