Results 1 to 3 of 3
  1. #1
    iewnhoff is offline Novice
    Windows 10 Office 365
    Join Date
    Dec 2024
    Posts
    1

    Report with Query and 3 tables

    Hi everyone, first time here and it's been a while since I used access.
    I have a Datbase that for this purpose has 3 Tables.
    Table 1 - Events (Overall Information about a specific Event including Date)
    Table 2 - Menu Items (A List of Available Menu Items which is simply the Name of the Item and It's Unit Cost)
    Table 3 - Link Table (For Each selection of a Menu Item for an Event there is a record. There is the Primary Key of the Event, the Primary Key of the Menu Item, the Quantity, and a Calculated Field as to the Total Cost of the selection)

    Table 3 will have multiple records of a single event with the individual menu items selected, the quantity, and the calculated total for that item.

    All is well. Except.


    I am struggling on creating a report that shows, for a given year and month (we are good here) a list of each event (from the event table) and the summed value of the ordered items (table 2 and table 3)

    I think I need some multiple FROM statements, but I keep getting errors when I try to group by my Event ID.
    Any help is greatly appreciated.

    Bill

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Why don't you provide database for analysis? Follow instructions at bottom of my post.

    Should be fairly simple to group by Event and sum the cost with expression in group footer textbox: =Sum(TotalCost)

    Apply year/month filter to report when opening.
    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
    madpiet is offline Expert
    Windows 10 Office 365
    Join Date
    Feb 2023
    Posts
    565
    Quote Originally Posted by iewnhoff View Post
    Hi everyone, first time here and it's been a while since I used access.
    I have a Datbase that for this purpose has 3 Tables.
    Table 1 - Events (Overall Information about a specific Event including Date)
    Table 2 - Menu Items (A List of Available Menu Items which is simply the Name of the Item and It's Unit Cost)
    Table 3 - Link Table (For Each selection of a Menu Item for an Event there is a record. There is the Primary Key of the Event, the Primary Key of the Menu Item, the Quantity, and a Calculated Field as to the Total Cost of the selection)

    Table 3 will have multiple records of a single event with the individual menu items selected, the quantity, and the calculated total for that item.

    All is well. Except.
    I am struggling on creating a report that shows, for a given year and month (we are good here) a list of each event (from the event table) and the summed value of the ordered items (table 2 and table 3)

    I think I need some multiple FROM statements, but I keep getting errors when I try to group by my Event ID.
    Any help is greatly appreciated.

    Bill
    Events---(1,M)--EventMenuItems[Quantity]--(M,1)--MenuItems [UnitCost]

    then create a query and add a calculated column LineTotal:EventMenuItems[Quantity] * MenuItems[UnitCost]

    then sum that in your report.

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

Similar Threads

  1. Replies: 4
    Last Post: 11-03-2020, 10:32 AM
  2. Tables and relations and PK;s and FK''s and FU's
    By Karaline in forum Database Design
    Replies: 4
    Last Post: 02-28-2017, 08:35 AM
  3. Replies: 4
    Last Post: 08-24-2016, 06:48 AM
  4. Replies: 3
    Last Post: 01-05-2012, 12:04 PM
  5. Joining tables two tables and another table that is not
    By DevintheDude in forum Database Design
    Replies: 0
    Last Post: 09-12-2007, 08:56 AM

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