>Thanks for the replies, I think Jim's suggestion is probably worth a try. No matter where and how you construct the "SELECT" string, you cannot put more than 255 chars in the property "RowSource". At the moment I am using a two-stage SELECT, the first is a SELECT statement into a temporary cursor and the second one is a "SELECT * " ,with an additional bunch of conditions, from the temporary cursor into the grid's RowSource.
>
>Rgds
>Petras
Petras,
Actually the rowsource property can be longer than 255 characters, I believe it has the same limit as any other character variable 2 gigabytes. It is the property sheet that has the limit and prevents you form entering more than 255 characters. If you were to assign the rowsource proeprty in the Init code for the grid it would probably just fine.
THIS.RowSource = "SELECT a lot of fields " + ;
"FROM a lot of tables " + ;
"WHERE a lot of conditions " + ;
"GROUP BY a lot of grouping stuff " + ;
"ORDER BY a lot of ordering stuff " + ;
"INTO CURSOR MyGridData"
Leave the rowsource blank in the property sheet but set the rowsourcetype to SQL.