Results 1 to 9 of 9
  1. #1
    Join Date
    Sep 2018
    Posts
    4

    Print Reports by day for next week with Correct Dates

    Good Afternoon,
    We currently have reports that need printing on a Friday and cover Saturday through to the next Friday.
    Each report must have the days date on it, currently we have a Report per day of the week where Saturday's header is " =Now()+1" and Sundays is "=Now()+2".


    Then a Macro prints all of the reports for the week.
    Ideally we would like one report and be able to get the date in the footer correct for everyday of the next week.
    Any help would be greatly appreicated.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Are these reports to print blank forms for pen on paper entry? There is no data? If there is no data (no records) there is no way to define a group section in order to distinguish page breaks.

    Need more info.
    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
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Ideally we would like one report and be able to get the date in the footer correct for everyday of the next week.
    By this I'm going to assume there is data and that it may be different for each day.

    Your single report needs to be based on a query or sql statement that includes the day/date in question, or at least calculates it. Then by some user action, code would cycle through a list of day values and open the report for each day in a date range. The days values could come from 2 textboxes that provide the start and end dates, or you could calculate the needed days based on a "week" choice - maybe from a comb0. The problem would be that the report has to close and reopen to reflect the next day's data in your report header or footer. You could do this programmatically easily enough if just sending to the printer, but I confess I don't know how to pause the calling code (that which opens a series of reports) unless using the modal property of a report would work. In that case, the next report shouldn't open until the current one is closed, but I've never done that.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    I have code that calls same report object for printing multiple reports in sequence.

    It's not really clear to me what OP needs.

    If this is to print 'blank' forms with a page for each date and no data, a UNION query can serve as report RecordSource.

    SELECT Date()+1 As DayDate FROM anytable
    UNION SELECT Date()+2 FROM anytable
    UNION SELECT Date()+3 FROM anytable
    UNION SELECT Date()+4 FROM anytable
    UNION SELECT Date()+5 FROM anytable
    UNION SELECT Date()+6 FROM anytable
    UNION SELECT Date()+7 FROM anytable;

    Then set the Detail section of report ForceNewPage property to AfterSection.
    Last edited by June7; 09-19-2018 at 10:29 PM.
    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
    Join Date
    Sep 2018
    Posts
    4
    Hi June7,
    Sorry I left out information details, the reports are populated by a query which shows employees per department.
    The page breaks are set per department so all the employees within that department are displayed on one page.
    These are reports to print blank forms for pen on paper entry
    Thanks

  6. #6
    Join Date
    Sep 2018
    Posts
    4
    Hi Micron,
    There is data from a query, although it is the same data everyday of the week, the reason for the report per day at the moment is just so we can get the date right.
    Thats a very good idea, I will give that a go.
    Thanks

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    You have a multi-page report of data you want to repeat for each day with that day's date at top. And you would like to have only one report object print once instead of seven reports printed in sequence. A UNION query might still be able to facilitate.

    SELECT Date()+1 As DayDate, DeptID, EmpID FROM tableORquery
    UNION SELECT Date()+2, DeptID, EmpID FROM tableORquery
    UNION SELECT Date()+3, DeptID, EmpID FROM tableORquery
    UNION SELECT Date()+4, DeptID, EmpID FROM tableORquery
    UNION SELECT Date()+5, DeptID, EmpID FROM tableORquery
    UNION SELECT Date()+6, DeptID, EmpID FROM tableORquery
    UNION SELECT Date()+7, DeptID, EmpID FROM tableORquery;

    Add whatever fields you need and whatever table joins are needed in each SELECT. Use report Sorting & Grouping features. The DayDate will be the top level group. Because this is grouping by a date value, make sure set for 'by day'. Set group footer section ForceNewPage property.

    Now just print one report.
    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
    Join Date
    Sep 2018
    Posts
    4
    Hi June7,
    Thats great thank you very much for all your help

  9. #9
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    june7's idea sounds better. I didn't realize you had one report with 7 sections. I thought you wanted 1 report per day.

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

Similar Threads

  1. Query dates for current week and prior
    By farmerde in forum Queries
    Replies: 3
    Last Post: 01-28-2016, 03:58 PM
  2. Replies: 9
    Last Post: 06-19-2015, 03:37 PM
  3. Show start of week between dates
    By Perceptus in forum Reports
    Replies: 1
    Last Post: 11-04-2014, 03:48 PM
  4. Using VBA to print a report based off day of week
    By jo15765 in forum Programming
    Replies: 1
    Last Post: 10-21-2013, 02:10 PM
  5. Converting Dates into week numbers (custom)
    By Bleep-Blop in forum Programming
    Replies: 5
    Last Post: 10-04-2013, 03:29 PM

Tags for this Thread

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