Solved

Filtering continuous form with Radio Buttons

Posted on 2011-09-17
4
336 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 39

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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Suggested Solutions

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

803 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