If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
Form takes time to Recalc and causes #Error
I have a form with a lot of textboxes that have formulas based on other
textboxes on the same form. Some even call user-defined functions. But they all calculate correctly. However, I noticed that it takes time for the form to finish "calculating" before I can start entering data. About 5-8 seconds. One strange behaviour is that if a user tries to move one of the form's scroll bars while it is in "calculating" mode (in status bar), some textboxes end up showing #Error. But if we wait until it finishes calculating, everything is ok. Is there any solution to this? 1) Maybe to disable the form until it finishes calculating. 2) Or maybe keep the form hidden until the calculating is finished? Is this possible in VBA? Thanks! |
#2
|
|||
|
|||
Similar problem too...
I need to know how to determine that a form's calculating has finished.
Copied from my post on MSDN asking this.... My setup: A form with buttons to run reports and other routines, containing a sub-form that shows a detail row per site w/ a DLookup on a query that sums all of the dollar fields to produce a Total Recipts by site for the currently selected period (Month-Year which are unbound controls on the main form) The Total Recipts calculation takes about 10 seconds to complete, during which "Calculating..." shows on the status bar. If a button is clicked while calculating, it causes my other form that needs to have the focus set on a control (so that it will be shown on top of the main form) to loose focus and thus get covered it up. How can I determine when the sub-form is done calculating? So that I can then set the necessary focus and bring it to the front, or Enable the buttons (after the are disabled as the form 1st opens or when the period changes - both of which trigger the calculation) -- Regards, John and also a tip what NOT to do... Here is what NOT to do... I tried adding a text box control on to the footer of the sub-form... =If(IsNumeric([GTTR]),"Done Calculating","Please Wait...") GTTR is the grand total for the total recipts on the footer that is the sum of all the Total recipts from the detail rows. It caused a "Not enough memory..." error that corrupted the form so that not only could I not open the form, I couldn't even open it in design to delete that control. I'm guessing that I caused a runaway recursive loop. Luckily I had an earlier verison of the form in question that I could import back from a backup. Still wondering how do you check to see if a form is done calculating... -- Regards, John Ray C wrote: Form takes time to Recalc and causes #Error 28-Sep-09 I have a form with a lot of textboxes that have formulas based on other textboxes on the same form. Some even call user-defined functions. But they all calculate correctly. However, I noticed that it takes time for the form to finish "calculating" before I can start entering data. About 5-8 seconds. One strange behaviour is that if a user tries to move one of the form's scroll bars while it is in "calculating" mode (in status bar), some textboxes end up showing #Error. But if we wait until it finishes calculating, everything is ok. Is there any solution to this? 1) Maybe to disable the form until it finishes calculating. 2) Or maybe keep the form hidden until the calculating is finished? Is this possible in VBA? Thanks! Previous Posts In This Thread: On Monday, September 28, 2009 9:42 PM Ray C wrote: Form takes time to Recalc and causes #Error I have a form with a lot of textboxes that have formulas based on other textboxes on the same form. Some even call user-defined functions. But they all calculate correctly. However, I noticed that it takes time for the form to finish "calculating" before I can start entering data. About 5-8 seconds. One strange behaviour is that if a user tries to move one of the form's scroll bars while it is in "calculating" mode (in status bar), some textboxes end up showing #Error. But if we wait until it finishes calculating, everything is ok. Is there any solution to this? 1) Maybe to disable the form until it finishes calculating. 2) Or maybe keep the form hidden until the calculating is finished? Is this possible in VBA? Thanks! EggHeadCafe - Software Developer Portal of Choice Migration 2003-2007 Project Server details http://www.eggheadcafe.com/tutorials...007-proje.aspx |
Thread Tools | |
Display Modes | |
|
|