Need help with IIf statement

S

Scott A

This IIf statement should create dynamic groupings for a
report based on the values selected by the user from the
option group on a form.

I have a form with three group options, each of which
should designate the field which should be used to group
data on a report.

In order to accomplish this, I would like to insert an
IIf statement into the Sorting and Grouping property of
the report. I am having a little trouble building the
IIf statement (as I am not very familiar with them...)

I m wondering how to write an expression that selects the
appropriate grouping parameter from any one (or even no
selection) of the three options I am providig in the
option group on the form.

Ideas?
 
D

Duane Hookom

Your options should have option values of 1, 2, and 3. This allows you to
use the Choose() function. Your column in the query would be something like:

SortMe:Choose(Forms!frmA!optSortMe, [FieldA], [FieldB], [FieldC])
 

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