Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
I requery a grid and lose all code in textboxes, and for
Message
 
To
01/04/2009 21:56:12
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01392592
Message ID:
01392693
Views:
44
>>>I have a grid that has an sql statement as a recordsource as an sql statement, and recordsourcetype as sql. when the grid gets focus, I requery the sql.I lose all of my settings for the grid and any code that I placed in the text box.
>>>
>>>What did I forget to do?
>>>
>>>TIA,
>>>Mike
>>
>>Nothing, This is default behavior of the Grid. If you close the Table/Cursor which is RecordSource of the Grid the Grid becomes unusable. The better way is to use so called Save Select. I think Andy and Marcia have an article how to do this.
>>(I see Tore already show you how to do this)
>>Other way it to reset the recordsource before you refresh the select and set it back after that:
>>
>>thisform.Grid1.RecordSource = []
>>SELECT ..... INTO CURSOR SomeName;
>>thisform.Grid1.RecordSource = [SomeName]
>>
>
>
>I think also that a CA handles all this internally - the "Safe Select" part I mean.

Yes, you could use CAs an Views w/o any problems. REQUERY()/.CURSORRFERESH() didn't close the Cursor.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Reply
Map
View

Click here to load this message in the networking platform