![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
Try declaring a module-level variable, setting it to a specific value upon first invocation, then setting it back when the function's complete. In that way, you can check the value of the variable in the Click event. "Bob Darlington" wrote in message news:4e647988$0$2446$afc38c87 (AT) news (DOT) optusnet.com.au... I can't work out how to intercept a second call to a function if a user clicks a command button a second time in rapid succession. I've tried using DoEvents but that doesn't work. If I use a message box, that does the trick, but I don't want a message box to appear at this point. Using Access 2002 and 2010. -- Bob Darlington Brisbane |
#4
| |||
| |||
|
|
I can't work out how to intercept a second call to a function if a user clicks a command button a second time in rapid succession. I've tried using DoEvents but that doesn't work. |
#5
| |||
| |||
|
|
On Mon, 5 Sep 2011 17:27:12 +1000, "Bob Darlington" bob (AT) notheredpcman (DOT) com.au> wrote: I can't work out how to intercept a second call to a function if a user clicks a command button a second time in rapid succession. I've tried using DoEvents but that doesn't work. Actually DoEvents allows this to happen although you frequently want DoEvents. Also consider setting the hour glass as a psychological barrier to waiting. Do ensure you set the hour glass back in the error handling though. Docmd.Hourglass Finally if appropriate, such as a recordset loop or running 10 queries in a row, having a progress bar in your app. See the Progress Bars and Microsoft Access page at http://www.granite.ab.ca/access/progressbar.htm for more info. Tony |
#6
| |||
| |||
|
|
I can't work out how to intercept a second call to a function if a user clicks a command button a second time in rapid succession. I've tried using DoEvents but that doesn't work. If I use a message box, that does the trick, but I don't want a message box to appear at this point. Using Access 2002 and 2010. |
#7
| |||
| |||
|
|
On Mon, 5 Sep 2011 17:27:12 +1000, "Bob Darlington" bob (AT) notheredpcman (DOT) com.au> wrote: I can't work out how to intercept a second call to a function if a user clicks a command button a second time in rapid succession. I've tried using DoEvents but that doesn't work. Actually DoEvents allows this to happen although you frequently want DoEvents. Also consider setting the hour glass as a psychological barrier to waiting. Do ensure you set the hour glass back in the error handling though. Docmd.Hourglass Finally if appropriate, such as a recordset loop or running 10 queries in a row, having a progress bar in your app. See the Progress Bars and Microsoft Access page at http://www.granite.ab.ca/access/progressbar.htm for more info. Tony -- Tony Toews, Microsoft Access MVP Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/ For a convenient utility to keep your users FEs and other files updated see http://www.autofeupdater.com/ |
#8
| |||
| |||
|
|
"Bob Darlington" <bob (AT) notheredpcman (DOT) com.au> wrote in news:4e647988$0$2446$afc38c87 (AT) news (DOT) optusnet.com.au: I can't work out how to intercept a second call to a function if a user clicks a command button a second time in rapid succession. I've tried using DoEvents but that doesn't work. If I use a message box, that does the trick, but I don't want a message box to appear at this point. Using Access 2002 and 2010. How quickly are you talking about? I guess it has to be slower than the code takes to run. Would it be too kludgy to just put in a loop to make it take longer for the function to run, so that the second click is ignored? -- David W. Fenton http://www.dfenton.com/ contact via website only http://www.dfenton.com/DFA/ |
#9
| |||
| |||
|
|
I didn't understand your first paragraph. |
#10
| |||
| |||
|
|
On Thu, 8 Sep 2011 11:35:09 +1000, "Bob Darlington" bob (AT) notheredpcman (DOT) com.au> wrote: I didn't understand your first paragraph. If you didn't have a DoEvents in there then the user might not have been able to click the button. Tony -- Tony Toews, Microsoft Access MVP Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/ For a convenient utility to keep your users FEs and other files updated see http://www.autofeupdater.com/ |
![]() |
| Thread Tools | |
| Display Modes | |
| |