Solved

Why the value DataGrid.Row is limitted within 10

Posted on 2002-06-06
1
154 Views
Last Modified: 2010-05-02
The DataSource property of this DataGrid is an ADODC. After User change the data, I want the DataGrid focus on the Changed row. The Codes are:

    Dim lngBookID As Long
    'grd2Books is a DataGrid
    lngRePlace = grd2Books.Row 'Get the Current Row
   
    'Modify the Data
     ...............
    'adoBooks is ADODC, the DataSource of DataGrid
     adoBooks.Recordset.Move lngRePlace, adBookmarkFirst
       
But when I select the row after 10th, the value of lngReplace remains 9 for ever.  why??
0
Comment
Question by:Iaskyou
1 Comment
 
LVL 39

Accepted Solution

by:
appari earned 50 total points
ID: 7061254
grd2Books.Row  returns the current row no from visible rows.

for your purpose use grd2Books.Bookmark insted of grd2Books.Row




   Dim lngBookID As Long
   'grd2Books is a DataGrid
   'lngRePlace = grd2Books.Row 'Get the Current Row
   lngRePlace = grd2Books.Bookmark
   'Modify the Data
    ...............
   'adoBooks is ADODC, the DataSource of DataGrid
    adoBooks.Recordset.Move lngRePlace, adBookmarkFirst


hope this helps
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…

746 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

17 Experts available now in Live!

Get 1:1 Help Now