Information générale
Catégorie:
Gestionnaire d'écran & Écrans
One of the subtle things that is happening is that the requery is reissuing the query select statement creating a NEW cursor that is almost like the previous but not quite. By this I mean that the grid is bound to the first query data not by name (although it appears that way) but by an internal file handle. The requery that re-executes the select statement creates a NEW cursor with a new internal file handle and deletes the old one. Your grid is now bound to something that does not exist!
There are two ways around this. Just before the requery say grid.recordsource = SPACE(1). do the requery and then set the record source back to the cursor name.
The other method is to create a view of the data you want (using a parameter if you need to limit the data returned.) Set the grid recordsource to the view. The requery of the view does not issue a new select statement (at least not in a way that changes the internal handle)
Bob
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