Link to home
Start Free TrialLog in
Avatar of semcoray
semcoray

asked on

Problem when scrolling a Datagrid with arrow keys

I have a Datagrid populated from a ADO Data Control. My datagrid can show about 5 records from the recordset. When the user selects a record from the datagrid I fill text boxes with additional data from the chosen record. When ever you scroll (arrow) to the next record in the Datagrid the text boxes are updated with that records info. If I use the scroll bar and expose a row down the list and then mouse onto the row it works OK. I use RowColChange and/or SelChange to fire the query for the text boxes.
This works great until you try and scroll up or down to the next record when it is not showing in the datagrid. The events do not appear to fire when arrowing to the next record when not shown.
I have the same problem with an MSFlexgrid with out a Data Control.
Help.
ASKER CERTIFIED SOLUTION
Avatar of TimCottee
TimCottee
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of semcoray
semcoray

ASKER

I had tried the MoveComplete event unsuccessfully and your last sentence explains why. I am referencing a datagrid column in my query to fetch the PK field to populate the rest of my text boxes. I should be referencing the Data Controls current record instead.

I do not know how to do that!
I have refernced the Data Control and it works as advertised.
varPKNumber = adodc1.Recordset!PKNumber

Tim thanks for the help.