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

    Unanswered: filter the entire database?

    I am confounded.

    I'm not really a db developer, it just kind of evolved into my hands.

    I have a Time and Attendance database that tracks hours by tasks, employee numbers departments and cost centers.

    I now need to filter all of my forms and reports by department numbers or cost centers, sometimes by ranges of dates or employee numbers.

    Is there a way to set a filter so that all of my reports will be based on this filter? The other option would be to be able to filter by fields that may not appear on a report. For example, I have a report that shows:

    [project number] [project name] .... [hours worked] [OT hours]
    ..........(from project table) .............(from Time&Expense table)

    This report is based on a query of the Time&Expense table.

    I need to have this report created only on employees in department 19 (from Employees table). I have created a filtering dialog with options to set the filters. I just can't seem to get filters to work in OpenReport commands.

    I am trying to avoid creating a huge number of queries for every possible filter combination.

    Pete
    Last edited by pcbpete; 04-06-04 at 19:34.

  2. #2
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    You can make a public variable say PubFilter
    in every Report put in the Report_Open event the next code

    Me.FilterOn
    Me.Filter=pubFilter


    Naturally you should define your pubFilter and fill it with the suitable criteria

  3. #3
    Join Date
    Apr 2004
    Posts
    3
    I wasn't sure I'd be able to explain this properly.

    I was using the OpenReport with a filter, or a filter expression. The problem is that the erport I'm trying to open, and the query it's based on, do not contain the field I want to filter. So it can't resolve the filter. Or should I be able to do this anyway and I'm missing something?

  4. #4
    Join Date
    Oct 2003
    Location
    US
    Posts
    343
    to have the filter work you must have all the required fields. In your case I am sensing some huge overhauling of your app. ie. changing all the reports so that your filter criteria can be applied to all the reports.


    Originally posted by pcbpete
    I wasn't sure I'd be able to explain this properly.

    I was using the OpenReport with a filter, or a filter expression. The problem is that the erport I'm trying to open, and the query it's based on, do not contain the field I want to filter. So it can't resolve the filter. Or should I be able to do this anyway and I'm missing something?

  5. #5
    Join Date
    Apr 2004
    Posts
    3


    I was hoping not to hear that, though I was sort of expecting it.

    One would think there would be a way to apply a filter to a table, opened or not, and have it stick until it was turned off!

  6. #6
    Join Date
    Oct 2003
    Location
    US
    Posts
    343
    sorry buddy, you cannot apply filter on any field of a table. the field must be part of the report's record source.


    Originally posted by pcbpete


    I was hoping not to hear that, though I was sort of expecting it.

    One would think there would be a way to apply a filter to a table, opened or not, and have it stick until it was turned off!

Posting Permissions

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