Information générale
Catégorie:
Codage, syntaxe et commandes
Hi Denis,
The nRow and nColumn parameters are relative to the visible portion of the grid and have nothing to do with its ControlSource. You can Activate a cell not in the grid's visible display area. If I understand correctly what you are after I assume that the process of finding the value has already positioned you on the correct record in the grid's RecordSource.
Calling the grid's Refresh method will put that row in the visible portion of the grid's display. Then use the column's SetFocus() method to put the highlight on the correct cell.
So...
** Execute the code to find the recno() and column in the RecordSource
GO lnRecordNumberWithFoundValue
Grid.Refresh()
Grid.Columns(lnColumnContainingValue).SetFocus()
HTH
Pamela
>Ive added a Find function to a form with a grid, attempting to partially emulate the wonderful Browse Ctrl+F find. Having located the correct grid cell, Im having all sorts of trouble highlighting or selecting this cell so the user sees the find result. I have setfocus to the grid, tried to activate the cell using row and column and select the text. Any clues much appreciated.
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