Need help Filtering 
Author Message
 Need help Filtering

Hello All,
        I,m really new with M S Access. I,m using Access97. Here's my
problem, I have a query with 3 joined fields. I need to set up a filter that
has two different criteria. The first is between three fields, each of these
field are either blank or have this value field one "C", field two "W",
field three "N". I've set up a option group with three option buttons to
control this filter. The second criteria for this filter is the first column
of the query and currently has 17 different values with the possibility of
adding more. I set up a list box that links to a table with the 17 current
values. I then put a control button on the form to apply these to filters.
I'm now having a lot of trouble with the code. Can someone please help me?
Thank You!
J.McAllister


Thu, 26 Apr 2001 03:00:00 GMT  
 Need help Filtering
The second criterion is the easy one.
If the first field of your query is Field_1 and your combobox is Combo_2
(with text data), you could use this code behind your command button.

dim criterion as string
criterion="[Field_1]='" & Combo_2 & "'"
docmd.applyfilter , criterion

Do you want to apply this filter at the same time as the other one?  Or are
they alternatives?

I'm not clear on what you want to do with your first filter, but I'm
guessing that this is what you want behind your Option_AfterUpdate: (I'm
calling the control Option_3)

dim criterion as string
select case Option_3
        case 1
                criterion="[Field_4]='" & "C" & "' OR isnull([Field_4]"
        .
        .
        .
        .
        end select
docmd.applyfilter,criterion

HTH
        - Turtle


Quote:
> Hello All,
>         I,m really new with M S Access. I,m using Access97. Here's my
> problem, I have a query with 3 joined fields. I need to set up a filter
that
> has two different criteria. The first is between three fields, each of
these
> field are either blank or have this value field one "C", field two "W",
> field three "N". I've set up a option group with three option buttons to
> control this filter. The second criteria for this filter is the first
column
> of the query and currently has 17 different values with the possibility
of
> adding more. I set up a list box that links to a table with the 17
current
> values. I then put a control button on the form to apply these to
filters.
> I'm now having a lot of trouble with the code. Can someone please help
me?
> Thank You!
> J.McAllister



Thu, 26 Apr 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Need Help Filtering data with VB 6.0 and Crystal 7.0

2. PLEASE HELP!! Need help with filter

3. Filter Problem....Need Help

4. HELP - Need to Disable Filters

5. HELP - Need to Disable Filters

6. Need help:menu item to save as query a filter by form

7. OWA message filtering help needed, getting desperate....

8. Need help to filter a file content plz

9. Need help to filter a file content

10. Filter in subform in Access (need help)

11. Needing Help with filters

12. Help Needed:Filter Property (CommonDialog)

 

 
Powered by phpBB® Forum Software