Results 1 to 6 of 6
  1. #1
    Faiz12 is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2022
    Posts
    5

    Count the record in subdatasheet

    I'm trying to count the number of records in the subdatasheet for each equipment ID and put them into total clients field automatically. For example the Equipment ID 1 will have 1 in its total clients field while Equipment ID 2 will have 2 in its total clients field since it has 2 record in its subdatasheet if that makes sense

    Click image for larger version. 

Name:	Screenshot 2022-04-08 102308.png 
Views:	18 
Size:	17.4 KB 
ID:	47648

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Tables don't work that way. Would need code to save this data into Total Clients, however, should not save aggregate data to table - calculate when needed. Build queries and/or report using Sorting & Grouping with aggregate calcs.

    Strongly advise not to use space in object naming convention. Also advise not to work directly with tables and queries for data entry and viewing - use forms and reports.
    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. #3
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,821
    Also it is advised NOT to allow Datasheet View

  4. #4
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    Quote Originally Posted by mike60smart View Post
    Also it is advised NOT to allow Datasheet View
    You must be referring to a form, so why not?
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #5
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,821
    My apologies Micron, I meant to say Subdatasheets

  6. #6
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    Quote Originally Posted by mike60smart View Post
    My apologies Micron, I meant to say Subdatasheets
    NP. IMO they're only useful for testing during development. If one follows the unwritten (?) commandment about not allowing users into the tables, then they're of no consequence.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Subdatasheet Issue
    By rmoore in forum Access
    Replies: 4
    Last Post: 06-16-2021, 03:05 AM
  2. Replies: 4
    Last Post: 01-15-2019, 11:50 AM
  3. Replies: 5
    Last Post: 02-24-2017, 08:09 AM
  4. Updating Multiple Record Form Based on Record Count
    By William McKinley in forum Forms
    Replies: 2
    Last Post: 12-31-2014, 12:45 PM
  5. Replies: 9
    Last Post: 10-14-2013, 02:23 PM

Tags for this Thread

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