[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

Filtering continuous form with Radio Buttons

Posted on 2011-09-17
4
Medium Priority
?
371 Views
Last Modified: 2012-05-12
I am trying to filter a continuous form with some radio buttons using select case statement.  For some reason I cannot get it to work at all.  I need to use two different sets of radio buttons one set is MODE and one is STATUS.    Is the select case incorrect?


    Me.opt_Shipped = False
    Me.opt_statusAll = False
    Me.opt_notScheduled = False

   'Me.Filter = "[APPT DATE-TIME] > 0"  <<<<<<<<<THIS WORKS
    'Me.FilterOn = True
    'Exit Sub
   
   

Select Case Me.opt_scheduled   <<<<<<<< THIS DOES NOT WORK
        Case 1
            opt_scheduled = True And Me.opt_modeAll = True
            Me.Filter = "[APPT_DATE_TIME] > 0"
            Me.FilterOn = True
        Case 2
            Me.opt_scheduled = True And Me.opt_truck = True
            Me.Filter = "[APPT_DATE_TIME] > 0 And [METH] = 'TR'"
            Me.FilterOn = True
        Case 3
            Me.opt_scheduled = True And Me.opt_rail = True
            Me.Filter = "[APPT_DATE_TIME] > 0 And [METH] = 'RR'"
            Me.FilterOn = True
        Case 4
            Me.opt_scheduled = True And Me.opt_barge = True
            Me.Filter = "[APPT_DATE_TIME] > 0 And [METH] = 'BG'"
            Me.FilterOn = True
        Case 5
            Me.opt_scheduled = True And Me.opt_PickUp = True
            Me.Filter = "[APPT_DATE_TIME] > 0 And [METH] = 'PU'"
            Me.FilterOn = True
        End Select
0
Comment
Question by:pskeens
  • 2
4 Comments
 
LVL 40

Expert Comment

by:als315
ID: 36555597
Can you upload your DB with sample data?
0
 
LVL 77

Accepted Solution

by:
peter57r earned 2000 total points
ID: 36555714
Your case statament is not structured correctly

Select Case Me.opt_scheduled  
    Case 1

means ..if the value of me.Opt_scheduled = 1 then ...

but you follow this with ..
 opt_scheduled = True And Me.opt_modeAll = True
which has no meaning in this context.

Please explain the first condition in words and we should then be able to provide the required structure
0
 
LVL 2

Author Comment

by:pskeens
ID: 36556486
Holy Crap Peter, I'm suffering from late night programming brain fade!  You are absolutely correct.  I fixed the case statement with this:

    Select Case Me.opt_notScheduled
        Case Me.opt_notScheduled = True And Me.opt_modeAll = True
            Me.Filter = "[APPT DATE-TIME] is null"
            Me.FilterOn = True
        Case Me.opt_notScheduled = True And Me.opt_barge = True
            Me.Filter = "[APPT DATE-TIME] is null and [METH] = 'BG'"
            Me.FilterOn = True
        Case Me.opt_notScheduled = True And Me.opt_PickUp = True
            Me.Filter = "[APPT DATE-TIME] is null AND [METH] = 'PU'"
            Me.FilterOn = True
        Case Me.opt_notScheduled = True And Me.opt_truck = True
            Me.Filter = "[APPT DATE-TIME] is null AND [METH] = 'TR'"
            Me.FilterOn = True
        Case Me.opt_notScheduled = True And Me.opt_rail = True
            Me.Filter = "[APPT DATE-TIME] is null AND [METH] = 'RR'"
            Me.FilterOn = True
        End Select

Thanks for waking me up!  
0
 
LVL 2

Author Closing Comment

by:pskeens
ID: 36556487
Yes this explains what I was doing wrong.  Not sure what I was thinking.  

Thanks for your help once again!
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
In a use case, a user needs to close an opened report by simply pressing the Escape (Esc) key. This can be done by adding macro code in Report_KeyPress or Report_KeyDown event.
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
The Relationships Diagram is a good way to get an overall view of what a database is keeping track of. It is also where relationships are defined. A relationship specifies how two tables connect to each other. As you build tables in Microsoft Ac…

612 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question