>>>>I have a grid in which the RecordSourceType is "SQL Statement". I supply a RecordSource SQL string in the grids init. Can I change that RecordSource SQL sting at run time to something different? How do I get the grid to requery since it is not a view.
>>>>
>>>>Thanks
>>>
>>>You should issue:
>>>Grid.Recordsource=""
>>>Grid.Recordsource=cMynewsqlstring
>>>Grid.Refresh
>>
>>All I do is issue Grid.Recordsource=cMynewsqlstring and the grid is smart enough to do the rest :)
>
>It depends on situation (column.controlsources etc. might have to be restored) and weather :)- refresh may not fire implicitly.
Correct me if I'm wrong here, but when using an SQL statment as the record source the grid *totally ignores* the control source...so they are a non-issue. With recordsourcetype = 4 you must structure the SELECT statement to put the fields in the order of the grid columns. Grids with SQL record source types are my primary tool for lookup routines, and I've never had to refresh one for it to trigger...I simply change the recordsource, normally via a method that fires from the interactive change event of one or more text boxes (or check boxes or combos or option groups).