Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to filter a Grid (BROWSE FOR id_user=123, but with G
Message
From
09/04/1998 09:51:37
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00090364
Message ID:
00090746
Views:
25
Hi Colin,

Pardon me for barging in, but I am having a similar problem. I have 3 forms containing one grid each, which contains a view of multiple tables. To find the data the user is interested in, I am using a query-by-form so the user can input data in any field. I decided to use parameterized views for this, but the SQL code generated in View Designer gives me the message "SQL statement too long" (there are a lot of fields). Then, I decided to build a SELECT statement based on the fields that the user put data into (chances are, they won't put data in very many fields). In the Load Method of the form I have put a SELECT statement which finds all the records INTO CURSOR AGENTS_VIEW (which is what the 1st form's Grid displays). I have set the Grid.RecordSource = AGENTS_VIEW and the Grid.RecordSourceType = Alias. Up to this point everything works great. The next SELECT statement INTO CURSOR AGENTS_VIEW gives me nothing (not even headers - just a blank grid). If I quit my application and re-execute it, the Grid displays the last SELECT statement (provided I turn off the one in the Form's Load). This tells me it did it and is still in memory, but just didn't display it. Now, to where you come in. You mention that the Grid.RowSource is lost and must be reset. I can't find a Grid.RowSource, did you mean Grid.RecordSource? If so, I have tested this property after each SELECT statement and it is still equal to AGENTS_VIEW. Also, I can use SET FILTER after the first select instead of SELECT and it works, but SET FILTER has other problems. I have also tried DELETE VIEW AGENTS_VIEW before I run the next SELECT statement, but that doesn't work either. I would sure like to use subsequent SELECT statements into the same grid/view if I could, but I'm not sure how. Do you have any suggestions?

Thanks.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform