TEXT TO lcSql TEXTMERGE NOSHOW Select <<thisform.cLookupField>> From <<thisform.cLookupAlias >> where <<thisform.cLookupField>> = tcLookup Into Array laLookup ENDTEXT &lcSql>I seem to recall having problems in the past trying to use "Thisform.Whatever" property references in certain places in a SQL call, so, now I tend to do this tecnique to get the form properties into local vars and then using the local vars in the SQL:
>lcLookupTable=this.cLookupAlias >lcLookupField=this.cLookupField >lcWhereClause= lcLookupTable + '=' + tcLookup > >Select &lcLookupField From &lcLookupTable Where &lcWhereClause Into Array laLookup >>
>Select (thisform.cLookupField) From (thisform.cLookupAlias) where (thisform.cLookupField)=tcLookup Into Array laLookup >>