Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Check if field exists

edited March 2002 in General
I have created a report that performs a calculation on a field which may or
may not exist in the pipeline. I would like to be able to check to see if
the field exists and if not then use a different field for my calculation.
Can anyone tell me how to do this?

Thanks in Advance,
Nick

Comments

  • edited March 2002
    I do this frequently and this technique works for me.

    I assume you are TppVariable. basically, create two OnCalc event
    handlers. Put each of the different calculations in different event
    handler.

    In the AfterOpen event for the TQuery, spin through the FieldDefs to
    look for the field name in question. Assign the event handler based
    on the outcome of this search.

    - Rich Poletti
This discussion has been closed.