Results 1 to 5 of 5
  1. #1
    CHOO is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2014
    Location
    England
    Posts
    5

    Counting Users as 1, 2, 3, and 4?

    Hi,



    Is it possible to count the amount of users within a table. For example if a user appears 4 times I want to show it as User1,User2,User3 and User4.

    Thanks.

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Users should be in forms, not tables. You can check to see if a form is open within a given Access file. When a user has a bound form open, they are not continuously "inside a table" or "have a table" open. As they edit, add, navigate, etc. the form updates the table as needed. The following will tell you if a table object is open, not if another object is accessing the table.

    Code:
    Dim intCheck As Integer
    
    intCheck = SysCmd(acSysCmdGetObjectState, acTable, "TableName")
    
        If intCheck = 0 Then
            MsgBox "The table is not open"
        Else
            MsgBox "The table is open"
        End If

  3. #3
    CHOO is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2014
    Location
    England
    Posts
    5
    Thanks for the reply. Bit confused. I have a table with 45000 user IDs. If that user appears more then once I want to show this as User1, User2 etc in another column within the table. I thought some sort of Count query would do this. Thanks.

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Yah, I was a bit confused too. If you want to count records that have fields that = something, try creating a Totals query and select the "Count", in the totals field to replace "Group By".

    As for adding a columns that have User1 User2 etc., perhaps your best bet is to use a Crosstab Query. I do not use crosstab queries but maybe you can get a Totals/Crosstab query hybrid to get the results you are looking for.

  5. #5
    CHOO is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2014
    Location
    England
    Posts
    5
    Hi, Thanks for the help. Managed to it with a bit of SQL.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Counting in
    By tngirl in forum Reports
    Replies: 7
    Last Post: 05-24-2013, 11:15 AM
  2. Counting
    By GeirA in forum Queries
    Replies: 7
    Last Post: 02-29-2012, 02:58 PM
  3. Counting Help
    By Jessyx in forum Access
    Replies: 1
    Last Post: 12-03-2011, 01:34 AM
  4. Counting Yes No Fields
    By pwilson in forum Queries
    Replies: 3
    Last Post: 11-29-2011, 10:29 AM
  5. Counting
    By rfs in forum Forms
    Replies: 0
    Last Post: 03-15-2011, 03:20 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums