Replacing DAO data control Reposition event

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?
PhilChandlerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

planoczCommented:
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
planoczCommented:
PhilChandler did not response to my correct answer.
Split points planocz and  part refund
0
PhilChandlerAuthor Commented:
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
PashaModCommented:
Closed, 500 points refunded.
PashaMod
Community Support Moderator
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.