?
Solved

Replacing DAO data control Reposition event

Posted on 2003-12-10
5
Medium Priority
?
418 Views
Last Modified: 2012-05-04
I am migrating an application from DAO to ADO.  One particluar form had a datacontrol_Reposition event.  I have replaced this with a datacontrol_MoveComplete event, but my problem is that it fires when I don't want it to.  The Repostion event only fired when navigating from one record to another.  I would like the MoveComplete event to work the same way.  I have tried to limit when the MoveComplete fires without any luck.  Can someone help?
0
Comment
Question by:PhilChandler
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 27

Expert Comment

by:planocz
ID: 10260677
Hi PhilChandler,
 This is what microsoft says about moving from DAO reposition to ADO reposition.....

Use the AbsolutePosition property to move to a record, based on its ordinal position in the Recordset object, or to determine the ordinal position of the current record. The provider must support the appropriate functionality for this property to be available.

AbsolutePosition is 1-based and equals 1 when the current record is the first record in the Recordset. As mentioned previously, you can obtain the total number of records in the Recordset object from the RecordCount property.

When you set the AbsolutePosition property, even if it is to a record in the current cache, ADO reloads the cache with a new group of records starting with the record you specified. The CacheSize property determines the size of this group.

Note   You should not use the AbsolutePosition property as a surrogate record number. The position of a given record changes when you delete a preceding record. There also is no assurance that a given record will have the same AbsolutePosition if the Recordset object is requeried or reopened. Bookmarks are the recommended way of retaining and returning to a given position and are the only way of positioning across all types of Recordset objects.

If you need more help let me know.



0
 
LVL 27

Expert Comment

by:planocz
ID: 10942495
PhilChandler did not response to my correct answer.
Split points planocz and  part refund
0
 

Author Comment

by:PhilChandler
ID: 10949731
I was able to solve my problem in the following way:
I added the following IF statement when entering the event to control when it would execute the rest of the code:

   If ((adReason = adRsnMoveFirst) Or (adReason = adRsnMoveNext) Or _
       (adReason = adRsnMovePrevious) Or (adReason = adRsnMoveLast)) Then

This allowed the rest of the code to be executed only when a move occurred.  I know that this is not how the event is supposed to work, however, we were upgrading from DAO to ADO technology and this was the quickest fix, without doing a complete rewrite.

AbsolutePosition had nothing to do with my problem or solution, but I thank you for taking the time to anwer planocz.
0
 

Accepted Solution

by:
PashaMod earned 0 total points
ID: 10971699
Closed, 500 points refunded.
PashaMod
Community Support Moderator
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month14 days, 2 hours left to enroll

800 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