If/Then

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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.
 
No, that is pretty much exactly what I wanted to know.

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

Regards,
 
Back
Top