K
Kunjal Karamshi
I seem to be having a problem with Access Xp in that if a
user clicks a button and clicks it again after a few
seconds, the click event fires again even though the code
has not yet completed executing the first time.
To illustrate this I have a piece of code as shown below:
Private Sub Button1_Click()
Dim i As Long
For i = 1 To 1000000
DoEvents
Next i
End Sub
If I run this code, I can click the button and click it
again a few seconds later and the event will fire again. I
was even able to place the form in design mode while the
code was still running!
Is this behaviour by design or is it a bug? On my side
this has lead to subtle errors whenever a user clicks on a
button twice. Is there any way of turning this behaviour
off?
Kunjal
user clicks a button and clicks it again after a few
seconds, the click event fires again even though the code
has not yet completed executing the first time.
To illustrate this I have a piece of code as shown below:
Private Sub Button1_Click()
Dim i As Long
For i = 1 To 1000000
DoEvents
Next i
End Sub
If I run this code, I can click the button and click it
again a few seconds later and the event will fire again. I
was even able to place the form in design mode while the
code was still running!
Is this behaviour by design or is it a bug? On my side
this has lead to subtle errors whenever a user clicks on a
button twice. Is there any way of turning this behaviour
off?
Kunjal