Solved

Filtering continuous form with Radio Buttons

Posted on 2011-09-17
4
360 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 500 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 learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
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…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

617 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