Access 2003 Filter on form

Joined
Sep 20, 2012
Messages
1
Reaction score
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!
 
Joined
Mar 12, 2012
Messages
1
Reaction score
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top