>>Hi All:
>>
>>How do I requery a grid? In other words, my rowsource is SQL with a WHERE clause, so every time the condition changes I want to requery. There is no requery on a grid.
>>
>>Refresh doesn't seem to do the job.
>>
>>Yossi
>
>The best solution will be in using safe select approach.
>
>See
http://weblogs.foxite.com/andykramek/archive/2005/03/19/174.aspxHi Naomi,
I referred to an answer you gave me a few years ago.
My problem is I'm not changing the WHERE; I'm changing the columns. I still want to stay with safe select, however, since I might want to add fuctionality to modify the WHERE as well.
This is the code I'm trying to run in the CLICK of an option group:
DO CASE
CASE THIS.option1.VALUE = 1
lcCustomerColumns = GenerateColumns('')
CASE THIS.option2.VALUE = 1
lcCustomerColumns = GenerateColumns('FAIR')
ENDCASE
lcSql = "SELECT curStock.desc, " + lcCustomerColumns + " FROM curStock"
THISFORM.safeselect(lcSql, "curGrid")
thisform.gridrefresh()
The problem is that the cursor that the grid is bound to (curGrid) doesn't change its columns.
Thanks
Yossi