Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2008
    Posts
    13

    Unanswered: Finding all occurences of items linked to OrderID on a Report

    I've created a report which prints an invoice. It's recordsource is a query which finds the last OrderID that was created. I then look up Customer Info and Products using that info. The problem I'm having is that a customer may order more than one item and my report is only returning the first item order.

    In my OrderDetails table I have these fields:

    [tblOrderDetails]
    OrderDetailID (Primary key)
    OrderID
    ProductID
    Quantity
    Total Price

    For every OrderID, there could be several entries with different ProductIDs. How do I pull in all ProductIDs associated with one OrderID on the report?

    I am using DLookUp to find the ProductID of the last OrderID created on the report.

    Thanks

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    Because of the one-to-many relationship, normally I'd use a subreport to display the products on the order. That way you can display however many items there are dynamically.
    Paul

  3. #3
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Yup. Just use a subreport in the same way as you would have a subform.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  4. #4
    Join Date
    Mar 2008
    Posts
    13
    Thanks, that worked.

Posting Permissions

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