Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2011

    Question Unanswered: passing output from DoCmd.OpenReport to a procedure?

    I will rephrase and simplify my earlier question on this forum. Is there a way of passing the result of DoCmd.OpenReport stDocName, "qryFilterLetter" to a procedure?

    I need to pass the document thus generated to a procedure for printing to a multi-tray printing function. How can this be achieved? Thank you!

  2. #2
    Join Date
    Mar 2009
    Provided Answers: 14
    DoCmd does not return any value (as a function would). It is a method of the Application object (i.e. the current session of Access). You can create a reference (rpt in this example) to the open document, using:
    Dim rpt As Report
    Set rpt = Reports(stDocName)
    Have a nice day!

Posting Permissions

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