Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2004
    Posts
    6

    Unanswered: Question: Updating the Filter Criteria in a Report

    Greetings,

    I inherited an Access database and am trying to streamline some of the reporting that is needed but have run into one snag that I think is easily fixable.

    I'm running a report to show all records on a user by user basis. Users are defined by a User_ID (unique). The query pulls in all the users, and then within the report I've used the filter to show only the records for a specific user. Unfortunately, this means that to change which user I want to report on, I need to manually edit the User_ID number in the filter field.

    So, my question is: is there a way to update this field using the OnClick function from an unbound form?

    Thanks in advance for any help!

    Cheers,
    Mael

  2. #2
    Join Date
    Jan 2004
    Posts
    26
    Try this:


    Docmd.OpenReport "rptMyReport",acViewNormal,,"User_ID =" & Forms![YourUnboundForm]![YourField]


    Make sure the Filter On property is set to yes in the report design.


    HTH
    Scott

  3. #3
    Join Date
    Feb 2004
    Location
    Houston TX
    Posts
    23
    I havent tried Balinor's technique, but the way i would aproach it is more GUI.

    step 1.
    replicate your qry and the report that you want modified.
    step 2.
    go in the design mode of the report and change the datasource to the new qry name that you made.
    step 3.
    go the design mode of the qry, and inside of the ctiteria just type an understandable string, for example

    [Enter the user id to print the report for]

    this pops up an input box when you try to run the qry. once compete. save the qry.
    Step 4 .
    go to reports section and run the new report (the one attached to the modified qry). it will pop up the same input box so you can identify a different user every time you run the report.

    Hope it helps
    Believe Everybody Trust Nobody

Posting Permissions

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