Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Problem when scrolling a Datagrid with arrow keys

Posted on 2000-05-09
3
Medium Priority
?
226 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 150 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

876 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