Matthew,
Just build the whole select field list as one string:
lcFields = lookups.fldname1 + iif( lDoTwo, ", " + lookups.fldname2, "" )
select &lcFields ;
from ...
>If I have a table that stores information about my lookup tables as follows
>
>tblname,fldname1,fldname2
>
>so one record would be
>
>state,code,desc
>
>My query to get all of the records out of states is as follows
>
>
>field1 = lookups.fldname1
>field2 = lookups.fldname2
>
>select &field1,;
> &field2;
> from (lookups.tblname) into cursor qry
>
>This works fine, but how can I still run this qry if the value of field2 is empty?