Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Feb 2004
    Location
    Moundridge, Kansas, USA
    Posts
    342
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Number of orders for customer (Access 2003 SP2)

    I would like to have a small pop-up form or even just a field that would count how many times a customer has ordered. Something that is on my Orders form and is visible for every customer. I have no idea how to do that.

    Anyone willing to steer me in the right direction?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Number of orders for customer (Access 2003 SP2)

    You could put a text box on the form with a control source like this:
    <code>
    =DCount("*", "tblOrders", "[CustomerID] = " & [CustomerID])
    </code>
    where tblOrders is the name of the orders table, and CustomerID is the name of the field that identifies the customer; I have assumed it to be numeric. If it is a text field:
    <code>
    =DCount("*", "tblOrders", "[CustomerID] = " & Chr(34) & [CustomerID] & Chr(34))</code>

  3. #3
    3 Star Lounger
    Join Date
    Feb 2004
    Location
    Moundridge, Kansas, USA
    Posts
    342
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Number of orders for customer (Access 2003 SP2)

    Thanks. That did it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •