Results 1 to 4 of 4
  1. #1
    Hursan is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2021
    Posts
    23

    Value of a cell equal counts of other table

    I have two tables:



    Customer table:
    CustomerId-CustomerName-OrdersTotal


    Orders table:
    ID-CustomerID-Product-Cost-

    I want access to display the total number of orders on each customer Id found under the Order table.

    Is there a way to do this?

  2. #2
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,372
    Create a totals query based on tblOrders and insert a count on the CustomerID field. If you need the customer name, you'll have to include the customer table, equal joining on CustomerID. If you've never created a Totals query, now's a good time to research it.

    BTW, it is commonly considered poor practice to store calculated values, which is what your OrdersTotal suggests you're doing. Best to use forms/queries/reports to show totals.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    Hursan is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2021
    Posts
    23
    Quote Originally Posted by Micron View Post
    Create a totals query based on tblOrders and insert a count on the CustomerID field. If you need the customer name, you'll have to include the customer table, equal joining on CustomerID. If you've never created a Totals query, now's a good time to research it.

    BTW, it is commonly considered poor practice to store calculated values, which is what your OrdersTotal suggests you're doing. Best to use forms/queries/reports to show totals.
    I was able to create a totals query with the customerID and OrdersTotal, but I cannot figure out how to populate the OrdersTotal field from the number of orders total from the query table.

  4. #4
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,372
    Create an append or update query (whichever is required) and use the totals query as the query table source. Store these calculations at your own peril, I guess.
    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. Linked table working only for items that are equal
    By damngroundhog in forum Access
    Replies: 3
    Last Post: 09-23-2019, 09:54 AM
  2. Import Excel data cell by cell into an Access table.
    By russmann2000 in forum Import/Export Data
    Replies: 3
    Last Post: 03-21-2018, 07:18 PM
  3. Clear Cell Range Based on Text in Another Cell
    By Oxygen Potassium in forum Access
    Replies: 3
    Last Post: 08-20-2017, 08:12 PM
  4. Replies: 1
    Last Post: 07-12-2013, 01:48 PM
  5. Can we post Access cell data to Excel cell properties?
    By Zethro in forum Import/Export Data
    Replies: 1
    Last Post: 12-13-2005, 08:42 AM

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