Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2005
    Posts
    9

    Unanswered: printing current form/passing parameters to a report

    Does anyone have any suggestions on what would be a good way to pass a value to a printing report from a print report button on a form so that it only prints the current data being viewed? If there is a way to pass a variable to the report from the form then I already have it set up to do everything I need.

    Thanks

  2. #2
    Join Date
    Oct 2005
    Posts
    178
    Quote Originally Posted by mcyborg
    Does anyone have any suggestions on what would be a good way to pass a value to a printing report from a print report button on a form so that it only prints the current data being viewed? If there is a way to pass a variable to the report from the form then I already have it set up to do everything I need.

    Thanks
    Can you be more specific?

  3. #3
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926

    Report - passing parameters

    Take a look at the attached file. Maybe it might have something useful you can use. It uses the form: ReportForm where it gets the parameters to pass to the report.
    Attached Files Attached Files
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    its possible to send parameters to the report as part of the reports open command. have a look in the helpfile of the openreport method. You could use this for a relatively simple series of filters.

    there are other techinques that allow you to pull a parameter from elsewhere. I use it a lot for date banding, I uses a common form to set 'to' & 'from' dates, another form to select departments and carry thise values in the menu as discrete textboxes. I normally put in a default value in each container first.

    Queries, reports and forms can then use those values as required.

    to pull a value form the menu you use soemthing like
    =forms!<myformname>!<mytextboxvalue>

    the net result is a consistent way of handling a series of filters or limits. the only downside is the form containing the parameters has to stay open whilst the other form / report / query / runs.

    HTH

Posting Permissions

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