How to use the field/expression in Sorting and Grouping???

G

Guest

Hi,

I have been struggling to use the field/expression functionality.
I need to have 2 user defined headers on a report.
I have done a pre-filter in the control source so I can have 2 values, GEN
and EQUIP.

I thought it would be easy to then group my report based on these values by
using an expression in Sorting and Grouping -

tagfilter="GEN"
this I would assign to the first header

tagfilter="EQUIP"
this I would assign to the second header.

However it does not work. Maybe I completely mis-understand the way the
field/expression field can be used. I have seen other examples where you can
use the left function to strip off characters. Surely I can group based on
values being equal..

Thanks
Colm
 
M

Marshall Barton

Colm said:
I have been struggling to use the field/expression functionality.
I need to have 2 user defined headers on a report.
I have done a pre-filter in the control source so I can have 2 values, GEN
and EQUIP.

I thought it would be easy to then group my report based on these values by
using an expression in Sorting and Grouping -

tagfilter="GEN"
this I would assign to the first header

tagfilter="EQUIP"
this I would assign to the second header.

However it does not work. Maybe I completely mis-understand the way the
field/expression field can be used. I have seen other examples where you can
use the left function to strip off characters. Surely I can group based on
values being equal..


I think it does work, even if it's not doing what you want
it to do. Those expressions evaluate to True of False,
which is what the report will be grouped on, even if it
doesn't make much sense.

If tagfilter is a field in the report's record source
table/query, why not just group on the field?

If tagfilter is something else, it would help me understand
what you're trying to do if you would explain what it is and
whaere it's value comes from.

Maybe you don't want to use grouping at all. Would a text
box (in the report header?) using an expression like:
=IIf(tagfilter="EQUIP", "text for header1", "or header2")
in its control source do what you want?
 
D

Duane Hookom

This doesn't make any sense to me. What/where is tagfilter? You can use a
function or expression as a grouping and sorting control source in a report
if you begin with "=".
 

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