Results 1 to 11 of 11
  1. #1
    Hank153 is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Dec 2012
    Posts
    19

    Create Report that looks like a spreadsheet

    I'm trying to create a cemetery database in access 2003. The report we want should show the cemetery divided into Section (15), Rows (40) and Plots (1-70 in each row). Each section has 15 rows with 15 plots in each row. I have tables and a query set up with the Name, Section, Row and Plot of each grave. I would like the report to show a grid like sheet with a deceased name in the proper "cell". There should be plot numbers above each column and row numbers at each row.



    I'm sort of new at this and not much good with code. I appreciate any help and suggestions anyone can offer.

    Thanks, Hank153

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Data like:

    Name Section Row Plot
    Jones A 1 1
    Casey A 1 2
    Mason B 1 1



    Try a crosstab query:
    TRANSFORM First(Table1.Name) AS FirstOfName
    SELECT Table1.Section, Table1.Row
    FROM Table1
    GROUP BY Table1.Section, Table1.Row
    PIVOT Table1.Plot;

    The result is:
    Section Row 1 2
    A 1 Jones Casey
    B 1 Mason
    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
    Hank153 is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Dec 2012
    Posts
    19
    Looks like the results I need, but I'm not sure where the code should go. Can I use access 2003 crosstab wizard?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Yes, use the wizard.
    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
    Hank153 is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Dec 2012
    Posts
    19
    Thanks, it works ok now --except -- it will not show empty cells. I think I need to use the NZ function, but I'm not sure just how to use it and where it should go.

  6. #6
    Hank153 is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Dec 2012
    Posts
    19
    Sorry, I intended to include the code I'm using now. Can you show me where the NZ function should go?

    TRANSFORM First(tblNames.FullName) AS FirstofFullName
    SELECT tblNames.Section, tblNames.Row, First(tblNames.FullName) AS TotalOfFullName
    FROM tblNames
    GROUP BY tblNames.Section, tblNames.Row
    PIVOT tblNames.Plot;

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Don't think Nz will help here. What do you mean by 'empty cells'? Do you have a record for every section/row/plot even if the plot is not occupied? If not, can't show data for records that don't exist. If you want to show all plots even if not occupied, need a record for every section/row/plot even if not occupied. Could show 'Not Used' (or whatever) instead of name or just leave it blank.

    If you do have a record for every plot then don't understand the issue. All plots should show in the crosstab even if the name field is blank.
    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.

  8. #8
    Hank153 is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Dec 2012
    Posts
    19
    By empty I am saying either nobody is buried there or we have not identified who is there. My preference is to leave the cell blank - but to show the Section, row and plot cell on the report.

  9. #9
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Does table have records for every section/row/plot?

    Not sure how many records that would be because you seem to show contradictory numbers in first post.
    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.

  10. #10
    Hank153 is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Dec 2012
    Posts
    19
    There are 500 - 800 graves. At present I only have 520 names of people buried there. It's an old cemetery (early 1800's) with many unidentified graves. We have divided it into 15 sections with 14 rows - each row contains 15 plots(or graves) or 210 graves in each section. We are able to show one section on each page of the report - using legal size paper. The table does not have a record for every plot. But, I do need to show empty, unknown, or available plots. More sections may need to be added later. For now I'm only working with the 15 sections. You can see that leaves a lot of plots that are not identified at present.
    I know I could use the words "Empty" or "Unknown" to show those plots - but I prefer to have the left blank on the report.

  11. #11
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Okay, then the simplest solution for you may be to create a record for EVERY plot. If name unidentified, leave field empty. Then try the crosstab.
    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: 1
    Last Post: 08-21-2012, 05:30 PM
  2. How to create report
    By jags281173 in forum Reports
    Replies: 3
    Last Post: 08-09-2012, 02:27 AM
  3. Replies: 1
    Last Post: 03-05-2012, 04:21 PM
  4. how to create report
    By ngu059 in forum Reports
    Replies: 3
    Last Post: 01-19-2011, 04:46 PM
  5. Display report in spreadsheet style
    By w2vijay in forum Reports
    Replies: 1
    Last Post: 02-11-2010, 11:51 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