If/Then

G

Guest

I have looked at conditional macros and stuff, but still am not certain how I
would apply.

I have two "styles" of inventory items:
- Style ONE are items that I import as finished goods
- Style TWO are items that I build in my factory.

I have a report that prints out:

ITEM
- Component

(The report is grouped and sorted on ITEM, then grouped and sorted on
COMPONENT)

For various reasons, I set up my system where Component # = Item # for the
"Style ONE" items.

When I run the report, then, I get something that looks like this:

AMERICAN BEER
- Glass bottle
- Fizzy water
- Artificial beer flavor
- Label

IMPORTED BEER
- Imported Beer

What I'd like to do is for the Style TWO items, print it like above. For
Style ONE items, I'd like it to print a totally different field.

In other words, in the "Component" Field grouping, something like "If ITEM =
COMPONENT, then {OTHERFIELD}, otherwise {COMPONENT}".

I know there is "conditional formatting", but is there "conditional
reporting"?

Thanks
 
M

Marshall Barton

RJB said:
I have looked at conditional macros and stuff, but still am not certain how I
would apply.

I have two "styles" of inventory items:
- Style ONE are items that I import as finished goods
- Style TWO are items that I build in my factory.

I have a report that prints out:

ITEM
- Component

(The report is grouped and sorted on ITEM, then grouped and sorted on
COMPONENT)

For various reasons, I set up my system where Component # = Item # for the
"Style ONE" items.

When I run the report, then, I get something that looks like this:

AMERICAN BEER
- Glass bottle
- Fizzy water
- Artificial beer flavor
- Label

IMPORTED BEER
- Imported Beer

What I'd like to do is for the Style TWO items, print it like above. For
Style ONE items, I'd like it to print a totally different field.

In other words, in the "Component" Field grouping, something like "If ITEM =
COMPONENT, then {OTHERFIELD}, otherwise {COMPONENT}".

I know there is "conditional formatting", but is there "conditional
reporting"?


Depends on how you might want the layout to be different.
If you just want the different fields to be displayed in the
same text box, then it's as easy as using an expression in
the text box's ControlSource property:

=IIf(ITEM = "COMPONENT", OTHERFIELD, COMPONENT)

If that's not what you were asking for, post back with an
example of what you do want.
 
G

Guest

No, that is pretty much exactly what I wanted to know.

Thanks for the help. I love it when things are really easy.

Regards,
 

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