Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Filtering continuous form with Radio Buttons

Posted on 2011-09-17
4
Medium Priority
?
369 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

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

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

If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Explore the ways to Unlock VBA Project Password Excel 2010 & 2013 documents. Go through the article and perform the steps carefully to remove VBA Excel .xls file.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Suggested Courses

876 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