Results 1 to 2 of 2
  1. #1
    Kevo is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2011
    Location
    Kodiak, Alaska
    Posts
    86

    Requery and Print Reports?

    Hi All,



    TGIF!


    Here is what I want to do:

    When user closes database by closing Main Menu (splashscreen)....on close event will do the following:


    MsgBox "Would you like to print End of Day reports?" Yes/No

    If Yes then

    Print reports ( 2 reports that each have a different query as recordsource)

    Close application

    Else

    Close application


    So, my questions are:
    -Can a MsgBox trigger the next action? If so how.
    -The queries that are the recordsource of the reports I want to print have criteria that is driven by "dates" that are on a form. Can the query look at the "dates" even though the form isn't open? (keep in mind that the default value for these "dates" are already set to Date() which is what I want for the end of day report.

    -Lastly, I am not strong in VBA (ok, make that pretty much clueless) so, any help with this code would be greatly appreciated!


    Kevo

  2. #2
    Kevo is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2011
    Location
    Kodiak, Alaska
    Posts
    86
    BTW,

    Here is what I have tried so far....not much luck.

    Private Sub Form_Close()
    MsgBox "Print End of Day Reports?", vbYesNoCancel
    If VbMsgBoxResult.vbYes Then
    DoCmd.OpenReport "rptBILog", acViewNormal
    DoCmd.OpenReport "rptLoadDetails", acViewNormal
    DoCmd.CloseDatabase
    Else
    If VbMsgBoxResult.vbNo Then
    DoCmd.CloseDatabase
    Else
    DoCmd.CancelEvent
    End If
    End If
    End Sub

    One problem is as I suspected....it is asking for the criteria from the form that isn't open. Would you open query, print report, then close query? Seems like there is any easier way.

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

Similar Threads

  1. Replies: 2
    Last Post: 04-02-2012, 04:34 AM
  2. Problem in requery of reports in acess 2003
    By pratim09 in forum Reports
    Replies: 1
    Last Post: 08-02-2011, 07:28 AM
  3. Print Separate Reports with collate
    By HendriX99 in forum Reports
    Replies: 3
    Last Post: 02-04-2011, 07:46 AM
  4. Print different Reports at once
    By Brian62 in forum Reports
    Replies: 5
    Last Post: 01-21-2011, 11:19 AM
  5. Option to Print Sub-reports
    By Hotwheels59 in forum Reports
    Replies: 0
    Last Post: 06-21-2010, 03:29 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