Results 1 to 7 of 7
  1. #1
    4 Star Lounger
    Join Date
    Jan 2003
    Location
    Central Florida, USA
    Posts
    505
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Filtered data into Preformatted report (97 and 2k)

    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

  2. #2
    2 Star Lounger
    Join Date
    Sep 2001
    Location
    Wellington, Wellington, New Zealand
    Posts
    181
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Filtered data into Preformatted report (97 and 2k)

    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

  3. #3
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Filtered data into Preformatted report (97 and 2k)

    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 <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  4. #4
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Filtered data into Preformatted report (97 and 2k)

    <P ID="edit" class=small>(Edited by patt on 26-Feb-03 14:59. Give credit where it's due, to WTH)</P>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 <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  5. #5
    4 Star Lounger
    Join Date
    Jan 2003
    Location
    Central Florida, USA
    Posts
    505
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Re: Filtered data into Preformatted report (97 and 2k)

    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.

  6. #6
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Filtered data into Preformatted report (97 and 2k)

    You will have to make sure any of these fields mentioned are in your queries.
    Pat <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

  7. #7
    4 Star Lounger
    Join Date
    Jan 2003
    Location
    Central Florida, USA
    Posts
    505
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Re: Filtered data into Preformatted report (97 and 2k)

    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.

Posting Permissions

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