building a query "on the fly" based on radio buttons on a form

  • Thread starter Thread starter carroll.cauthen
  • Start date Start date
C

carroll.cauthen

I have a form with 8 "options" each having three radio
button choices. the user can only select 1 radio button
for each "option" How do I build a query utilizing
selection critiera specified in the radio buttons for each
of the 8 "options" Just to clarify, I don't want to build
8 queries, just 1 query utilizing 8 fields and the
selection criteria of the radio buttons.
 
I have a form with 8 "options" each having three radio
button choices. the user can only select 1 radio button
for each "option" How do I build a query utilizing
selection critiera specified in the radio buttons for each
of the 8 "options" Just to clarify, I don't want to build
8 queries, just 1 query utilizing 8 fields and the
selection criteria of the radio buttons.

You can put

=[Forms]![NameOfForm]![NameOfControl]

as a criterion. What are the field contents, and how do the radio
buttons relate to those contents?
 
Basically I have a "matrix" inside a table. This matrix has 8 groups of three related columns (good, average, bad) in the table.

Then your table violates second normal form. You're storing data in
fieldnames - ALWAYS a bad idea.

If you're going to do this in Access (as opposed to, say, Excel) you
would do much better to use a normalized table structure with fields
Option, HousingType, Quality, and Value; one record per number rather
than six numbers per record.

With your current non-normalized table structure you CANNOT do this
with a simple query - at least I haven't been able to figure out any
good way. You will need to write VBA code to construct the SQL of a
query based on the option groups.
 
Back
Top