Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2003
    Location
    paris, FRANCE
    Posts
    88

    Unanswered: Filter on a form

    Hello!
    Let's say I have a form which filters my results shown on a report.

    My first filter works like that: let's say I have field with clients 1,2 or 3 and with it I can choose by using a combo box wether I want all clients to appear on the report or only one of the three (here its three but there can be many more... but let's drop this as this filter works....).
    For this filter I use this SQL Statement:

    Code:
    SELECT DISTINCT tblresults2_RATIO.[Entreprise Cliente]
    FROM tblresults2_RATIO
    ORDER BY tblresults2_RATIO.[Entreprise Cliente];
    Now I have another field with a reliability percentage (ranging from 0 to 100% , duuuuuuuuuuuuuuuuuuuuuuh!! ). I 'd like to have, sorta like my first filter, a filter where I can choose only reliability percentage greater than 10, 20,50 ....

    Maybe I should use a combobox in which I input myself the data (10, 20,50 ....) but What is the SQL statement to make Access understand that I want only the data greater than the value chosen to appear on the report?

    Thx for your help!!!
    nico

  2. #2
    Join Date
    Jul 2003
    Location
    Italy
    Posts
    139
    I believe you should use a WHERE in your SQL.

    Let's say something like this:

    code:--------------------------------------------------------------------------------
    SELECT DISTINCT tblresults2_RATIO.[Entreprise Cliente]
    FROM tblresults2_RATIO
    WHERE yourtable.[thefieldwith%]<=[yourcombobox%]
    ORDER BY tblresults2_RATIO.[Entreprise Cliente];
    --------------------------------------------------------------------------------

    Hope I made it clear.
    Marco
    ---Do not send e-mail---
    "New Big Bang Theory: God said unzip universe"

  3. #3
    Join Date
    Apr 2003
    Location
    paris, FRANCE
    Posts
    88

    Question almost there!

    To make it easier, once my filter is activated I'd like records to appear only if their reliability is greater than a definite value (lets say 50%)
    Here's what I got down to:
    Code:
    SELECT DISTINCT Customers.[Entreprise Cliente]
    FROM Customers
    WHERE ((([Customers].[Fiabilité%])>=50))
    ORDER BY Customers.[Entreprise Cliente];
    but I am not sure of it!!

    cheers!
    nico

  4. #4
    Join Date
    Jul 2003
    Location
    Italy
    Posts
    139
    I've been playing around with your db, but with no luck. It seems to me that the problem is with the filter. It doesn't recognize the [Enterprise Cliente]. I tried to put a filter in the report 'manually' and it worked, but the filter via vb doesn't. Looks like it needs something like [Customers].[Enterprise Cliente].

    I don't have much time time but I will try later.
    Marco
    ---Do not send e-mail---
    "New Big Bang Theory: God said unzip universe"

  5. #5
    Join Date
    Jul 2003
    Location
    Italy
    Posts
    139

    Red face

    Sorry wrong post!
    Marco
    ---Do not send e-mail---
    "New Big Bang Theory: God said unzip universe"

  6. #6
    Join Date
    Apr 2003
    Location
    paris, FRANCE
    Posts
    88
    I wanna do this by using a combobox which, if selected, will interact on the data shown as all the entries with a reliability grade under 50 will disappear.

    Here's the code but I am doing something wrong!!!
    Code:
    SELECT DISTINCT Customers.[Entreprise Cliente]
    FROM Customers
    WHERE (((Customers.[% Fiabilité])>=[Forms]![frmFilter].[filter3]))
    ORDER BY Customers.[Entreprise Cliente];
    How can I have, when clicking on the combobox, a fifty (50)appear which would make the user understand that he's going to filter the data, and when he runs this filter have only the entries with reliability field higher than 50?



    One more thing how is the filter gonna know which value to take in order to remove the entries whose [Fiabilité%] value is less than 50 for example??? Where do I input this value in the properties of my combobox? in source control?
    Can it be that I Access doesn't know that the type of data is numerical????

    thx to anyone who can help
    cheers
    nico

Posting Permissions

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