Using radio button option group to set criteria for query

J

JoeA2006

I would like to create an option group of radio buttons to allow the user to
drill down to a group of records in a sub form. I have three choices and want
to use the choice as a criteria for the query. Is there a way to do this in
query designer?SQL? or VBA?
 
S

Steve Schapel

Joe,

Each Option Button within the Option Group has an Option Value property.
This willl be a number. The value of the Option Group itself is
determined by the value of the Option Value of the selected Option
Button. You can use this value in the criteria of queries. If the
field to which you are applying the criteria is numberical, you can
assign the applicable Option Values to the Option Buttons, and use the
Option Group's value directly in the query criteria, for ecample using
syntax such as...
[Forms]![NameOfFrom]![NameOfOptionGroup]
Otherwise, you will need to represent the value in the query that you
want to apply the criteria to, as a numerical value. This is typically
done either via a calculated field in the query, or via making a table
that links each possible field value with a numerical value, and
including this reference table in the query. If you need more explicit
help with doing this aspect, post back with details of the relevant
data, with an example of what you want to achieve via the query selection.
 

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

Top