Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    Jul 2002
    Location
    Sacramento, CA
    Posts
    193
    Thanks
    3
    Thanked 1 Time in 1 Post
    I have a main form / subform where the subform is a datasheet display. I'm attempting to utilize any filters a user may have applied in the datasheet as a filter in reports selected on the main form by capturing the subform filter value and passing it to Docmd.Openreport as the Where clause. All seemingly worked as expected where the filter is (tablename.fieldname comparison value) e.g. ([_qryWB_BidSubFormMaster].[BAMetric]="fs").

    However, when I tested a combobox I got ([Lookup_CklSmStatID].[CklSmStatDesc]="Followup") as the filter which doesn't match anything in the report recordset. The filter seems to be - ['Lookup_' & combobox control name].[related field name of column(1) display)="column(1) display value" instead of expected ([_qryWB_BidSubFormMaster].[CklSmStatID]=5). I'm guessing/hoping I have some combobox properties set incorrectly, but have not been able to find anything on this.

    Appreciate your thoughts and insights.
    Marty

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    How does the user apply the filters? Using things built into Access or things that you have provided?
    Regards
    John



  3. #3
    2 Star Lounger
    Join Date
    Jul 2002
    Location
    Sacramento, CA
    Posts
    193
    Thanks
    3
    Thanked 1 Time in 1 Post
    They ae using the standard Access filter cababilities in a datasheet form.

    In more testing, I've ruled out any buggy-control problem as I get the same me.filter results in a brand new db with a new datasheet form and droplist control using a Master table as the RowSource.

    I did come up with an acceptable workaround, assuming there is no fix through property settings or some other control definition correction. I've changed the control RowSourceType to 'Value List' and build the RowSource with code in the form's OnOpen by reading the Master table. The only down side to this is the value display when one clicks on the column's down-arrow filter. Instead of seeing the moe user friendly descriptive display values, only the numeric key values are shown, but at least it creates a valid where clause that can be used in a Docmd.OpenReport.

  4. #4
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    Can you change the report so that the filters work 'as is'. For data displayed on the datasheet with a combo box, use a combo with the same prorperties on the report.

    When you put a combo on a report, it just gets displayed as a text box.
    Regards
    John



  5. #5
    2 Star Lounger
    Join Date
    Jul 2002
    Location
    Sacramento, CA
    Posts
    193
    Thanks
    3
    Thanked 1 Time in 1 Post
    John,

    Thanks for the info, I'll give that a try.

    Marty

Posting Permissions

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