Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Hi Ellai.
>> This is the scenario: There is grid in a form and a command button. The comman button contains a select-sql command which filters a certain table.
I want the result of that selection to be directed to the grid when i press the button. Is there a way to this. <<
Sure. Quite a few. If the structure of the result cursor stays constant, my preferred approach is to define an updateable cursor in the form's load using CREATE CURSOR to use as the grid's RecordSource. Then, after you do your SQL SELECT into a temporary cursor, you ZAP the cursor you are using as the grid's RecordSource and append from your temporary cursor.
Otherwise, you can so something like this:
Thisform.MyGrid.RecordSource = ''
SELECT Yada, Nada, Blah, etc. etc. FROM SomeTable JOIN SomeOtherTable ON SomeCondition WHERE SomeOtherCondition INTO CURSOR GrdCursor
Thisform.MyGrid.RecordSource = 'GrdCursor'
Finally, you can look into setting up a parameterized view to use as the RecordSource for your grid.
Marcia
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement