I tried that Paul now the flexigrid doesnt refresh after entry of the SQL code.
Oh yeah i have changed it to query data1.recordsource but it still doesnt work.