UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Stop Code Execution, Access 2016    
 
   
Raas
post Mar 13 2018, 07:27 PM
Post#1



Posts: 542
Joined: 27-January 07
From: Northern Arizona


Is there a way to stop code execution during run-time and then resume it? And, yes, I know how to use the break mode and F5 and F8 in code view. I want to see the program iterate through about 7,000 records before I stop it and view a potential problem record.
This post has been edited by Raas: Mar 13 2018, 07:31 PM
Go to the top of the page
 
GroverParkGeorge
post Mar 13 2018, 07:36 PM
Post#2


UA Admin
Posts: 33,536
Joined: 20-June 02
From: Newcastle, WA


You could put a counter inside the loop and increment each time it iterates. Then when the counter reaches your pre-determined value, you can use a conditional to stop the code.
CODE
IntRecordCount = 0

--Open a recordset
Do While Not rst.EOF
    --Do Something Here
    IntRecordCount = IntRecordCount +1
    if IntRecordCount >= 7000 Then
        Stop
    End If

Loop
Go to the top of the page
 
Raas
post Mar 13 2018, 08:02 PM
Post#3



Posts: 542
Joined: 27-January 07
From: Northern Arizona


Simple and works!

Thank you.
Go to the top of the page
 
GroverParkGeorge
post Mar 13 2018, 08:05 PM
Post#4


UA Admin
Posts: 33,536
Joined: 20-June 02
From: Newcastle, WA


My two favorite things in VBA: Simple and effective.

Continued success with your project.
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    26th September 2018 - 01:48 AM