Access 2003 Filter on form

Discussion in 'Webmaster / Programming' started by Nerdherd#1, Sep 20, 2012.

  1. Nerdherd#1

    Nerdherd#1

    Joined:
    Sep 20, 2012
    Messages:
    1
    Likes Received:
    0
    Hello!
    I have a control (cbo_projects) on a form (frm_project_list)
    The control has a row source type of value list and row source of "all projects";"Pending Projects";"Validated projects"

    The fields that are actually in the table are "Pending Review", "Validated", "Validated with feedback" and also null values.

    If a user selects "all projects", they should get all, if they select "Validated Projects" they should get both "validated" and "validated with feedback". "Pending projects" would only pull "Pending Review" records.

    The field name that contains the status is "Review_status"

    Any idea of the best way to accomplish this?

    Thank you!
     
    Nerdherd#1, Sep 20, 2012
    #1
    1. Advertisements

  2. Nerdherd#1

    BMJames

    Joined:
    Mar 12, 2012
    Messages:
    1
    Likes Received:
    0
    In the _AfterUpdate event of the combo box, manipulate the filter of the form. For example, when 'All Projects" is the selection of the combo box set the filter off (me.form.filteron = false), or when either of the "Validated" cases is selected set the filter to instr(1, Review_Status, "Validated") = 1 (if the 'Validated' always starts in the first character of the value, otherwise use > 0) then set filteron = true.
    Not having played with it (and not remembering off the top of my head) you might have to be careful in the case of Null values for Review_status so you might need to use something like instr(1,nz(review_status,""),"Validated).
    HTH
     
    BMJames, Sep 29, 2012
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kakarot1980

    VB.NET 2003 - Problem with renaming form.text

    Kakarot1980, Aug 25, 2005, in forum: Webmaster / Programming
    Replies:
    1
    Views:
    910
    Kakarot1980
    Aug 25, 2005
  2. wazdaman

    Access form appointment maker

    wazdaman, Dec 29, 2005, in forum: Webmaster / Programming
    Replies:
    0
    Views:
    758
    wazdaman
    Dec 29, 2005
  3. Anilkumar

    Filter Error

    Anilkumar, Sep 7, 2009, in forum: Webmaster / Programming
    Replies:
    0
    Views:
    626
    Anilkumar
    Sep 7, 2009
  4. compooper
    Replies:
    0
    Views:
    696
    compooper
    Jun 9, 2011
  5. tmmogirl
    Replies:
    3
    Views:
    1,240
    tmmogirl
    Aug 27, 2012
Loading...

Share This Page