Results 1 to 10 of 10
  1. #1
    Join Date
    Mar 2004
    Posts
    9

    Unanswered: printing Reports at the End of a Week

    Is there a way to have a report print "itself" automatically every Saturday, rather than a user having to go through a menu and selecting that report to be printed, can the report be designed in such a way that it is printed without the user having to tell it to do so?

  2. #2
    Join Date
    Sep 2001
    Location
    Chicago, Illinois, USA
    Posts
    601
    You can do it entirely with Access.

    Or, ou can do it with Access and a scheduler program.
    Ken

    Maverick Software Design

    (847) 864-3600 x2

  3. #3
    Join Date
    Mar 2004
    Posts
    9

    Automatic Report Generation

    I know that Access can do that, what I need to know is how to do it

  4. #4
    Join Date
    Nov 2003
    Posts
    1,487
    Well...you can try this:

    Set the TimerInterval property for your main Form to 1800000. This is a 30 minute time period. What we want to do is fire the Form's On Timer event every 30 minutes.

    In the Form's On Timer event, we want to set conditions such as day of the week and the time of day before the report is printed. If the conditions are properly met then the report will be automatically printed.

    In the Main Form's On Timer event place this code:
    Code:
    If (WeekDay(Now()) = 7) And (Time >= #7:00:00 AM# And Time <= #7:31:00 AM#) Then
       DoCmd.OpenReport "myReportName"
    End If
    Where: myReportName is the name of the Access Report you want to generate and print.

    Here, the specified report will be printed on every Saturday of every week sometime between 7:00AM and 7:30AM.


  5. #5
    Join Date
    Mar 2004
    Posts
    9

    Cool Thanks for the Info

    CyberLynx,
    Thank you very much for the information, I will try most certainly try it.

  6. #6
    Join Date
    Sep 2001
    Location
    Chicago, Illinois, USA
    Posts
    601
    From my previous post, you CAN do this entirely withing Access (with the form timer stuff), but does it make sense to do it that way? No, it does not.

    I could program Excel to do this, but does it make sense to have an Excel document open, and running, 24/7 to print one report a week? No it does not.

    You SHOULD do this with a scheduler program, which comes with any of the newer MS OSs, and you should simply have it launch your Access program on that once a week schedule. Your Access program would autoexec into the report and then exit.
    Ken

    Maverick Software Design

    (847) 864-3600 x2

  7. #7
    Join Date
    Nov 2003
    Posts
    1,487
    A scheduler...what a unique idea should the time arise when I would like to run a scheduler in the background sending out yet another 'hook' to Windows.

    I would like to place something like this into my next Database. Can you please send a sample of how this can be accomplished. I would really like to use this method. There are many different applications where this can come in handy.

    Thanks in advance...

  8. #8
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    control panel -> scheduled tasks
    will walk u thru it.

    you might want to consider scheduling an "application lite" (i.e. minimal .MDE that just does what you want done (e.g. a report as in the original question) and then quits). opening your full application and then leaving it sitting there on the screen is not perfect.

    u will also probably want a table to record the fact that the report ran.

    izy
    currently using SS 2008R2

  9. #9
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,423
    Provided Answers: 8
    Quote Originally Posted by human_fuel
    Is there a way to have a report print "itself" automatically every Saturday, rather than a user having to go through a menu and selecting that report to be printed, can the report be designed in such a way that it is printed without the user having to tell it to do so?
    Here some Code I wrote YEARS ago

    Code:
    Function WEEKEND(dat) As Date
    If IsNull(dat) Then Exit Function
    dat = DateSerial(year(dat), Month(dat), Day(dat))
    If dat Mod 7 > 0 Then
    WEEKEND = dat - dat Mod 7 + 7
    Else
    WEEKEND = dat
    End If
    End Function
    Next_Sat_Date = weekend(AnyDate)
    it will return the next sat date great for weekly stats

    run a scheduler

    if weekend(date()) = date then
    it's saturday
    else
    bugger its not
    end if

    can even put the Weekend:Weekend(feildname) inside you querys
    hope this help

    See clear as mud


    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
    VB based on my own environment: vb6 sp5
    ASP based on my own environment: 5.6
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    MYLE
    YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.

  10. #10
    Join Date
    Feb 2004
    Location
    Indiana, USA
    Posts
    79

    Print every weekday

    Is there a way to have a report print every day?

    I need a new report every weekday morning for an 8:30 meeting. With my perpensity for flying in at 8:28 it would be very helpful to have it waiting for me.

Posting Permissions

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