Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Nov 2001
    Thanked 0 Times in 0 Posts

    Filter in Form (Access 2000)

    i have a form in tabular view enumerating the products contained in different orders. like that

    Productid ProductName Order OrdeeDate

    1 Apples 1345
    2 Pears 1345
    1 Apples 1890
    1 Apples 1880

    I want to filter the form and by clicking over any row that contains apples to obtain all the apples like that

    1 Apples 1345
    1 Apples 1890
    1 Apples 1880

    I have tried the following . I have named the tex t box containing the ProductID as TxtProductID.
    In the OnClick event i have:

    Me.FilterOn = True
    Dim strFilter As String
    strFilter = "[ProductID] = " & Me![TxtProductID]
    Me.Filter = strFilter

    The result i get is wrong.It shows only the first productid. So if i click on Pears i receive again filtered Apples.

    Can somebody help me ?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 31 Times in 31 Posts

    Re: Filter in Form (Access 2000)

    <P ID="edit" class=small>(Edited by HansV on 23-Oct-02 17:46. Added comment)</P>I don't see anything wrong. I did a quick test in one of my test databases and it worked as you want.

    But as a user, I would hate such a feature - just clicking in a form setting a filter? Why not use the built-in Selection Filter button?

    Added comment:
    Wait a minute - you should put Me.FilterOn = True after setting the Filter property. I did that automatically in my test, so that's probably why it worked.

Posting Permissions

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