Solved

Problem when scrolling a Datagrid with arrow keys

Posted on 2000-05-09
3
209 Views
Last Modified: 2013-12-26
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.
0
Comment
Question by:semcoray
  • 2
3 Comments
 
LVL 43

Accepted Solution

by:
TimCottee earned 50 total points
ID: 2792636
You might be better off firing the additional query to fill the text boxes from the ADODC1_MoveComplete event rather than the rowcolchange, this should fire whenever the record is moved in the underlying recordset and doesn't require that the datagrid has retrieved the row yet.
0
 

Author Comment

by:semcoray
ID: 2792933
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!
0
 

Author Comment

by:semcoray
ID: 2793033
I have refernced the Data Control and it works as advertised.
varPKNumber = adodc1.Recordset!PKNumber

Tim thanks for the help.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now