Solved

Command1.Enabled = False ??

Posted on 1998-06-14
3
311 Views
Last Modified: 2006-11-17
I have a form with only one Command Button.  When the user clicks the button, I execute a sub which sets Command1.Enabled = False.  Before the sub returns, I re-enable the Command1 button.
Problem:
If the user clicks the button while it is disabled, the sub will execute again upon return.  Why is this? I thought disabling a control prevented the click event from entering the event queue.  Any suggestions?
0
Comment
Question by:Erick37
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 1

Expert Comment

by:Cardo
ID: 1463263
Have you tried putting a DoEvents in your code before you re-enable the button.  Incase it is queuing things until it gets a chance to process them?

Cardo......
0
 
LVL 32

Author Comment

by:Erick37
ID: 1463264
Thanks Cardo, that was the problem.  Submit it as an answer for the points.
Regards, Eric
0
 

Accepted Solution

by:
eyaltil earned 50 total points
ID: 1463265
please close the question
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question