Hello,
I am in access 2003. I have a form on which the user enters numbers into one field and clicks a button called CrossCheck which calculates and auto-populates numbers into other fields based on the values which she has entered and then she verifies that those numbers are what she expects.
I want her to also have the option of breaking out of the cross check before it is complete, in case she realized she entered something wrong and doesn't want for the cross check procedure to finish running before she can change her entry. However, some of my users are not so great with remembering keyboard shortcuts, so I don't want to rely on them remembering Ctrl+ Break. Besides, I like to design things with as many action buttons as possible, so the user never has to feel lost when looking at a form and always knows what to click to perform any given task.
So for this purpose, I have declered a public variable called CrossCheckRan. In the load event of the main form, the variable is set to "Never ran".
At the very end of the CrossCheck procedure, CrossCheckRan is set to "Finished". This value is then used in another sub which is called when the user is ready to save the values she entered and checked (she won't be able to save unless CrossCheck= "Finished").
I have made a button called CrossCheckStop whose on click event is this:
In the Cross check procedure, I have a do while loop, which goes through the records until it reaches the end of the recordset and also checks if CrossCheckStop has been clicked since the last iteration of the loop began, like so:
I assume that this is supposed to check at the beginning of every iteration for the value of CrossCheckStop.
However, I am missing something in my set-up. When I try to click the CrossCheckStop button, it does not accept clicks. That is, it appears flat (the outline of the button does not turn dark) when I click it. That tells me that I can't click it while the CrossCheck code is running, and therefore the value is never set to "Broke out" and the loop of CrossCheck just keeps going until the end.
Also, when I click CrossCheckStop repeatedly 3-4 times, the code freezes and just sits there until I hit Ctrl+Break and then it breaks out successfully. But hitting Ctrl+Break is what I want to avoid to begin with.
Would anyone be able to point out why I can't get my CrossCheckStop button to terminate CrossCheck with just one click and avoid using Ctrl+Break?
Thank you!
I am in access 2003. I have a form on which the user enters numbers into one field and clicks a button called CrossCheck which calculates and auto-populates numbers into other fields based on the values which she has entered and then she verifies that those numbers are what she expects.
I want her to also have the option of breaking out of the cross check before it is complete, in case she realized she entered something wrong and doesn't want for the cross check procedure to finish running before she can change her entry. However, some of my users are not so great with remembering keyboard shortcuts, so I don't want to rely on them remembering Ctrl+ Break. Besides, I like to design things with as many action buttons as possible, so the user never has to feel lost when looking at a form and always knows what to click to perform any given task.
So for this purpose, I have declered a public variable called CrossCheckRan. In the load event of the main form, the variable is set to "Never ran".
At the very end of the CrossCheck procedure, CrossCheckRan is set to "Finished". This value is then used in another sub which is called when the user is ready to save the values she entered and checked (she won't be able to save unless CrossCheck= "Finished").
I have made a button called CrossCheckStop whose on click event is this:
PHP:
Private Sub CrossCheckStop_Click()
CrossCheckRan = "Broke out"
End Sub
In the Cross check procedure, I have a do while loop, which goes through the records until it reaches the end of the recordset and also checks if CrossCheckStop has been clicked since the last iteration of the loop began, like so:
PHP:
Do while Me.Nameslist.Form.CurrentRecord < Me.Nameslist.Form.Recordset.RecordCount
And Not CrossCheckRan = "Broke out"
I assume that this is supposed to check at the beginning of every iteration for the value of CrossCheckStop.
However, I am missing something in my set-up. When I try to click the CrossCheckStop button, it does not accept clicks. That is, it appears flat (the outline of the button does not turn dark) when I click it. That tells me that I can't click it while the CrossCheck code is running, and therefore the value is never set to "Broke out" and the loop of CrossCheck just keeps going until the end.
Also, when I click CrossCheckStop repeatedly 3-4 times, the code freezes and just sits there until I hit Ctrl+Break and then it breaks out successfully. But hitting Ctrl+Break is what I want to avoid to begin with.
Would anyone be able to point out why I can't get my CrossCheckStop button to terminate CrossCheck with just one click and avoid using Ctrl+Break?
Thank you!