>I have designed a report in which I want to use macro/name substitution for the fields. The actual field names in the .dbf are faciltime1, faciltime2,...faciltime12,drrtime1, drrtime2,...drrtime12, etc. I use m.rptfield1, m.rptfield2,...m.rptfield12 as the memvars which will be used for the substitution. For example, m.rptfield1 = 'faciltime1', etc.
>
>The problem I am having is that I keep getting error messages when i run the report. If I use the format &m.rptfield1 in the report, I get the message there is a syntax error. If I use (m.rptfield1) the report displays the first few letters of the field name, for example, "facil". Only when I use the actual name of the field in the .dbf do i get the proper results.
>
>My objective in using macro/name substitution is to eliminate the need to create 10 separate reports, all of which use the same format, but each of which uses a different field in the .dbf.
Instead of macro substitution or name expansion, use an EVAL() clause:
EVALUATE(m.rptfield1)
returns the value of the expression contained in the variable rptfield1. This can be a field name, variable name, 0or an expression, so it leaves you with considerable flexibility; for example, rptfield1 could be a simple field expression, like
faciltime1 or an expression like
SalesTotal+TaxAmount.
>
>Any help will be appreciated,
>
>Alan Zaben
>
cancer_survivor@yahoo.com