using radiobuttons to select query criteria

  • Thread starter Thread starter papa jonah
  • Start date Start date
P

papa jonah

I have a form that I use as a sort of GUI for running queries. My
dropdowns work great. Now I want to add three radiobuttons to dictate
what criteria will be used in another field.
My three radio button options will be:
BC
DC
AD

The chosen option will driver the criteria in the "Wt" field of the
query. (The Wt field has numeric values from 1-4.

What I want the criteria to translate to is "=1" for BC, "<>1" for AD,
or for DC, equal to anything.

Do I use a tiered IIF statement in the criteria for "Wt" in the query?
If so, how do I do that in Access speak?

TIA
 
Hi,


In SQL view, something like:


.... WHERE SWITCH( FORMS!formName!FrameName = 1, fieldName = 1,
FORMS!formName!FrameName = 2. fieldName
<> 1,
FORMS!formName!FrameName = 3, true )


I assumed your radio buttons are all under a OPTION FRAME control, which
returns 1 if BC is "selected"; 2 if DC is selected and 3 if AD is selected.



Hoping it may help,
Vanderghast, Access MVP
 
As this is only one of several criteria used in the query and it is
part of an "and" statement in SQL, should I place the "switch ..."
stuff where the current "<>1" exist?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top