Results 1 to 2 of 2
  1. #1
    Rawb is offline Expert
    Windows XP Access 2000
    Join Date
    Dec 2009
    Location
    Somewhere
    Posts
    875

    rs.PercentPosition Bug

    Just wondering if anyone else has run into this issue (and knows how to get around it).

    I have a VB code block that takes several minutes to run. To prevent the user from getting impatient and cancelling execution (which could potentially mess up 2-3 Tables in the DB), I've been trying to set up a rudimentary progress bar using the .PercentPosition Property of DAO Recordsets.

    The code block has three loops in it where it steps through several Recordsets (each containing thousands of Records). The Property works fine through the first loop, but once it gets to the second loop (which uses a different Recordset) it stops working and always returns 0%.

    The third loop uses yet another Recordset and .PercentPosition always returns 0% on it too.

    In the code, I never to anything with .PercentPosition except read the value into a Form field. I never attempt to modify it in any way.



    Also, as far as I can tell, the Recordsets continue function properly in all aspects other than their .PercentPosition Property.

    Has anyone else run into .PercentPosition just breaking like that? And how can I get around it?

  2. #2
    Rawb is offline Expert
    Windows XP Access 2000
    Join Date
    Dec 2009
    Location
    Somewhere
    Posts
    875
    Errr. . . So nevermind. . .

    Apparently I was deleting Records in the Recordset from inside the same loop that I was counting. Because of this, the total number of Records in the Recordset was constantly changing which apparently caused both .AbsolutePosition and .PercentPosition to break.

    Once I moved the delete portion to a Query (outside of the loop) everything worked fine.

Please reply to this thread with any new information or opinions.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums