Enter Choice into Query

B

Bruce Rodtnick

I would like to have my query on a subform choose a field from a Option
Group to use in the query. In other words, I want to be able to press
an option on the Option Group to decide how much I charge this customer.

I have a table with three different field for each record that tell what
rate scale to use: Education, Commercial, Personal

If I press the option button for Education, I want the subform
Facilities to use the Education rate for all entries in the Facilities
subform.

How do I accomplish this.

Bruce Rodtnick
 
R

Rebecca Riordan

The option group is going to return a numeric value. If you can control
your table structure, the easy solution would be to use a single field with
a value that corresponds to the option values for the controls. Then you
can simply reference the option group in the query:

Forms!<formName>!<optionGroupName>

If you can't change the table structure, you'll need to write code to set
the query parameters.

HTH

--
Rebecca Riordan, MVP

Designing Relational Database Systems
Microsoft SQL Server 2000 Programming Step by Step
Microsoft ADO.NET Step by Step

http://www.microsoft.com/mspress

Blessed are they who can laugh at themselves,
for they shall never cease to be amused...
 

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