Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating Mulitiple Controlsources in one macro.

Status
Not open for further replies.

JSMacD

Programmer
Mar 25, 2007
2
AU
I have a form which carries out a very simple calculation giving intermediate output to 3 text boxes which each have controlsources in a sheet.

If I run the macro the first control will update but not the other two - however if I run the control again the second one will update and finally if I run it one more time the last one will update.

Strangly enougth if you step through the program using F8 it works perfectly.

I have been able to work out that it is due to the program event handling as when one textbox is changed the program ends hence starting the program 3 times (with the same data) works.

Has anyone a way of allowing the program to run to completion (I have worked around it with an array temporaraly however I need a solution for a much more complicated section of code that I am working where an array will not help)

Thank you very much in advance

Jason
 
I have been able to work out that it is due to the program event handling
You may consider to play with the Application.EnableEvents property.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thank you works Brilliantly I just put Application.EnableEvents = false
before the function calls and then
Application.EnableEvents = true
after the calls to enable the updating functions to keep working.
1 button functionality works again!!!
Thanks again [thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top