Results 1 to 6 of 6
  1. #1
    franciszarf is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Sep 2015
    Posts
    3

    MS access report design trouble (badly needed for help)

    I have a table like this in my MS Access with the data on it


    Click image for larger version. 

Name:	1.PNG 
Views:	19 
Size:	30.3 KB 
ID:	21975

    but when I designed a report in access
    instead of getting an output like this

    Click image for larger version. 

Name:	expected.PNG 
Views:	19 
Size:	12.3 KB 
ID:	21976
    i got something like this...
    Click image for larger version. 

Name:	actual.PNG 
Views:	19 
Size:	14.3 KB 
ID:	21977

    can you please help me with my problem. Because some data are repeated
    and it's annoying.


    NOTE: The ID has its own header..

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    its your join, when you get repeated records, its the join.
    make 2 queries,
    Q1 , a union query (to get 1 list of child records)
    select id, name, Qty,Cost from tReplacements
    union
    select id, name, Qty,Cost from tFuel

    then Q2 is your report query (of master recs)
    join Q1 to tEquip (1 join)
    report with this query.

  3. #3
    franciszarf is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Sep 2015
    Posts
    3
    I am new to using also queries in access sir can you please explain it
    as a novice like me can understand. Thanks a lot sir. By the way I am glad
    that there is a solution to my problem I will also try to research on queries.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    This data involves two dependent tables that have a many relationship to a master table. Including all 3 in one query will produce the results you show.

    If you want to display raw data, options are:

    1. report/subreport(s) arrangement.

    2. UNION query as described by ranman then use Sorting & Grouping features of report to organize the records by the two types of cost - recommend another field in the UNION to identify the type and each SELECT line can include a join to the Equipment table.

    SELECT Equipment.ID, Qty, Description, Cost, "Parts" AS Category, Model FROM [Replaced Parts] RIGHT JOIN Equipment ON [Replaced Parts].ID = Equipment.ID
    UN ION SELECT Equipment.ID, Qty, [Type], Cost, "Fuel", Model FROM [Fuel Cost] RIGHT JOIN Equipment ON [Fuel Cost].ID = Equipment.ID;

    There is no wizard or builder for UNION, must type into SQL View of query designer.

    If all costs were in one table to begin with, would not have this difficulty.

    Advise no spaces or special characters/punctuation (underscore is exception) in naming convention. Also, should not use reserved words as names - Type is a reserved word.
    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.

  5. #5
    franciszarf is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Sep 2015
    Posts
    3
    Hello sir I just tried the Union Query but what happened is that it combined the
    tables "replaced parts" and "Fuel Cost" ... what I want is that I will still display those two
    tables separately for easier review of the data.

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Options are still the same.

    With option 2 (UNION query), use report Sorting & Grouping features to organize data into the two groups. However, this approach will not allow the two groups to be side-by-side. For that, use option 1 - report/subreports.
    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.

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

Similar Threads

  1. Replies: 5
    Last Post: 09-12-2014, 06:41 AM
  2. avg/min/max data help needed badly
    By donavan01 in forum Access
    Replies: 7
    Last Post: 02-13-2011, 12:49 PM
  3. Using composite keys but stuck badly in the design
    By hmushtaq in forum Database Design
    Replies: 2
    Last Post: 01-25-2011, 12:25 AM
  4. Report trouble in Access 2000
    By blago in forum Reports
    Replies: 13
    Last Post: 09-16-2010, 07:12 AM
  5. Help with table design needed.
    By bobojones69 in forum Database Design
    Replies: 0
    Last Post: 08-10-2010, 02:08 PM

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