• Filtered data into Preformatted report (97 and 2k)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Filtered data into Preformatted report (97 and 2k)

    Author
    Topic
    #383939

    If this question has been asked, I apologize, but I could not find anything in the archive of messages.

    I have an Access database (and mde front end, and mdb backend) with a multi-tab form for data entry and/or review. Entering data requires “Adding” a new record, or “Editing” an existing record by clicking on the corresponding control which takes the form out of “Read Only” mode.

    When in the “Read Only” mode, the users will set filters using the “Filter by Selection” control to narrow the dataset based on their needs at the time. For example, they may have 4500 total records. They filter by a range of dates, and end up with 1500 records. They further filter by selection on the department, which for the sake of argument goes to 750 records. Further filter by selection on name of equipment results in 122 records. The user would now like to use one of the 50 or so existing reports to print out ONLY those 122 records. Is there a way to use the existing preformatted reports and use only those 122 records?

    Any help and/or ideas are greatly appreciated.

    kwvh

    Viewing 2 reply threads
    Author
    Replies
    • #656662

      Hi

      Is is possible to use the filter condition from the form in the where condition of the open report command.

      ie DoCmd.OpenReport reportname, acPreview, , “InvoiceID = 483 and Companyname = ‘Ache Ltd'”

      Regards
      WTH

    • #656663

      What you could do is to use the RecordsetClone property to write out these records to a temporary table then use the temporary table as the source of all those reports.
      HTH
      Pat cheers

    • #656669

      (Edited by patt on 26-Feb-03 14:59. Give credit where it’s due, to WTH)

      Another way to do this is to save the Me.Filter in the criteria of the OpenReport command. Although I think WTH has already suggested this, in which case his OpenReport statement would become:
      DoCmd.OpenReport reportname, acPreview, , Me.Filter
      Pat cheers

      • #656888

        Ok I will try this. However, I notice I did not indicate in initial post that all the reports are based on queries. Will this have any effect? Of special significance is what if the criteria in the filter includes a field NOT in the report query.

        For example, if I have filtered the data set, via form, for:
        Date, department, and employeename

        AND the report the user wants to print doesn’t contain the “employeename” in the report query, will it still run the report?

        Thx.

        • #656924

          You will have to make sure any of these fields mentioned are in your queries.
          Pat smile

          • #657261

            Thanks Pat and WTH. I can see this is going to involve some work. I am glad is not one of the many allergies that I have.

    Viewing 2 reply threads
    Reply To: Filtered data into Preformatted report (97 and 2k)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: