Solved

Filtering continuous form with Radio Buttons

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

760 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now