Problem updating a field on a form

Brian.Crawford

Board Regular
Joined
Oct 3, 2007
Messages
136
I have a form that processes data from a sheet on demand by the user clicking a button the form. Before starting the processing I put the word "Working" in the processed record count field and then at the end (30-60+ seconds later) I place the record count in that field. The code is:
Private Sub frmGetActuals_Click()
With frmManageWorkBook
.ActualsRecdNo = "Working"
FmtTrialBalance
.ActualsRecdNo =GetLastRow(Sheets("Actuals").Range("A:A"))
End With
End Sub
Overall the routine works but does not put the word "working" in the ActualsRecdNo on the form when the user clicks the button. But does put the count in at the end of processing.
HOWEVER - If I put in a breakpoint at the beginning and step through this SUB using the debugger (F8), when it executes .ActualsRecdNo = "Working", it does put the word in the field and displays it on the form.
Go Figure
would the state of;
Application.calculation or
Application.screenupdating
impact this form's display (I though only WS/WB) and if so why would the state be changed by the debugger
Any suggestions
Thanks in advance
Brian
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Hi Brian,

You would need the Application.ScreenUpdating to = True as it will not display any changes until the process is complete.

When you run it in debug mode, because you are taking it step by step, the screen will be updated.
 
Upvote 0
Thanks, thought maybe that might be the case
Can you tell me the "scope" of Application.Calculation & Application.Screenupdating. If I set them off in a parent SUB will they stay off throught lower level SUB calls until I reset them in the parent again. Or are they like "On error resume next" only having scope withing the SUB/Fucntion it is in?
thanks
Brian
 
Upvote 0
did a search and found that both "Application.--" are Excel wide (not just WB) and are determined by the first WB opend and stay until changed.
thanks
 
Upvote 0
Since it's a userform you could also try Repaint.
 
Upvote 0
Well Application.ScreenUpdating is application wide - you can use Repaint for just the form.
Code:
Me.Repaint
 
Upvote 0

Forum statistics

Threads
1,224,590
Messages
6,179,762
Members
452,940
Latest member
rootytrip

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top