The click method of a command button on my main form has the following code: DO FORM DrillDown.scx THISFORM.statistics
The secondary form updates data in a table. The statistics method calculates statistics on the table and updates the screen
When the main form command button calls the code above, the screen is not updated immediately. Another Debug button that calls the statistics method updates the screen properly.
What do I need to add so that the screen gets updated properly?
Thanks in advance,
Joe
--- StripMime Report -- processed MIME parts --- multipart/alternative text/plain (text body -- kept) text/html ---
In form DrillDown.scx, is the data accessed through the same data session as the calling form, or does it use its own private data session?
On Tue, Feb 23, 2016 at 11:30 AM, Joe Yoder joe@wheypower.com wrote:
The click method of a command button on my main form has the following code: DO FORM DrillDown.scx THISFORM.statistics
The secondary form updates data in a table. The statistics method calculates statistics on the table and updates the screen
When the main form command button calls the code above, the screen is not updated immediately. Another Debug button that calls the statistics method updates the screen properly.
What do I need to add so that the screen gets updated properly?
Thanks in advance,
Joe
--- StripMime Report -- processed MIME parts --- multipart/alternative text/plain (text body -- kept) text/html
[excessive quoting removed by server]
Thanks Ted,
Data sessions are something I have never tried to understand and are probably the cause for my confusion! Can you give me a quick fix or point me to something to read to get up to speed?
Thanks again,
Joe.
On Tue, Feb 23, 2016 at 11:35 AM, Ted Roche tedroche@gmail.com wrote:
In form DrillDown.scx, is the data accessed through the same data session as the calling form, or does it use its own private data session?
On Tue, Feb 23, 2016 at 11:30 AM, Joe Yoder joe@wheypower.com wrote:
The click method of a command button on my main form has the following
code:
DO FORM DrillDown.scx THISFORM.statistics
The secondary form updates data in a table. The statistics method calculates statistics on the table and updates the screen
When the main form command button calls the code above, the screen is not updated immediately. Another Debug button that calls the statistics method updates the screen properly.
What do I need to add so that the screen gets updated properly?
Thanks in advance,
Joe
--- StripMime Report -- processed MIME parts --- multipart/alternative text/plain (text body -- kept) text/html
[excessive quoting removed by server]
Does forcing a refresh() or draw() on the main form help?
You could put a timer on the main form to refresh the statistics display every x seconds.
The way I would do it is as follows (I always use form classes):
Your 'parent' form class, with a method 'UpdateStatistics' which refreshes the display of statistics. Your 'child' form class is displayed in code. It has an init() method with a property 'oCallingForm' which holds a reference to the 'parent' form.
So in your parent form button: loChildForm = createobject("frmChildForm", thisform) loChildForm.Show()
In the child form Init()
Lparameters loCallingForm This.oCallingForm = loCallingForm
So at some point in the child form you update your table. So you need to refresh the statistics on the parent form:
This.oCallingForm.UpdateStatistics()
On 23/02/2016 16:30, Joe Yoder wrote:
The click method of a command button on my main form has the following code: DO FORM DrillDown.scx THISFORM.statistics
The secondary form updates data in a table. The statistics method calculates statistics on the table and updates the screen
When the main form command button calls the code above, the screen is not updated immediately. Another Debug button that calls the statistics method updates the screen properly.
What do I need to add so that the screen gets updated properly?
Try thisform.refresh just below thisform.statistics
Peter
This communication is intended for the person or organisation to whom it is addressed. The contents are confidential and may be protected in law. Unauthorised use, copying or disclosure of any of it may be unlawful. If you have received this message in error, please notify us immediately by telephone or email.
www.whisperingsmith.com
Whispering Smith Ltd Head Office:61 Great Ducie Street, Manchester M3 1RR. Tel:0161 831 3700 Fax:0161 831 3715
London Office:17-19 Foley Street, London W1W 6DW Tel:0207 299 7960
Joe, Also sprinkle a number of Doevents around in your statistics method so that windows has enough time to regenerate the refresh loop.
Dave
-----Original Message----- From: ProFox [mailto:profox-bounces@leafe.com] On Behalf Of Joe Yoder Sent: 23 February 2016 16:31 To: profoxtech@leafe.com Subject: Controling the order/timing of processing after doing a form
The click method of a command button on my main form has the following code: DO FORM DrillDown.scx THISFORM.statistics
The secondary form updates data in a table. The statistics method calculates statistics on the table and updates the screen
When the main form command button calls the code above, the screen is not updated immediately. Another Debug button that calls the statistics method updates the screen properly.
What do I need to add so that the screen gets updated properly?
Thanks in advance,
Joe
--- StripMime Report -- processed MIME parts --- multipart/alternative text/plain (text body -- kept) text/html ---
[excessive quoting removed by server]
Thanks guys for the input.
The statistics method calls the form refresh already. I was confident that DOEVENTS would solve the problem but including one before calling and one every other line inside the method had no apparent effect.
I have not tried the timer - it seems like overkill but I did try a wait window before calling the statistics method. For some reason the wait window did not seem to show up.
I just now caught what is happening - the wait window comes up at the same time the secondary form comes up. That means the code after calling the form executes right away so I expect the solution is stop execution until the secondary form is exited. How do I do that?
Joe
On Tue, Feb 23, 2016 at 12:00 PM, Dave Crozier DaveC@flexipol.co.uk wrote:
Joe, Also sprinkle a number of Doevents around in your statistics method so that windows has enough time to regenerate the refresh loop.
Dave
-----Original Message----- From: ProFox [mailto:profox-bounces@leafe.com] On Behalf Of Joe Yoder Sent: 23 February 2016 16:31 To: profoxtech@leafe.com Subject: Controling the order/timing of processing after doing a form
The click method of a command button on my main form has the following code: DO FORM DrillDown.scx THISFORM.statistics
The secondary form updates data in a table. The statistics method calculates statistics on the table and updates the screen
When the main form command button calls the code above, the screen is not updated immediately. Another Debug button that calls the statistics method updates the screen properly.
What do I need to add so that the screen gets updated properly?
Thanks in advance,
Joe
--- StripMime Report -- processed MIME parts --- multipart/alternative text/plain (text body -- kept) text/html
[excessive quoting removed by server]
Joe Yoder wrote on 2016-02-23:
Thanks guys for the input.
The statistics method calls the form refresh already. I was confident
that
DOEVENTS would solve the problem but including one before calling and one every other line inside the method had no apparent effect.
I have not tried the timer - it seems like overkill but I did try a wait window before calling the statistics method. For some reason the wait window did not seem to show up.
I just now caught what is happening - the wait window comes up at the
same
time the secondary form comes up. That means the code after calling the form executes right away so I expect the solution is stop execution until the secondary form is exited. How do I do that?
Joe
Joe,
One way is to make the secondary form Modal.
Another way is to pass an object reference of the first form to the second form. It is received in Init. Do form secondary with thisform
Save the object reference passed to the Init to a property of the secondary form. In the Destroy event, call a method of the first form to continue processing. ThisForm.ParentForm.ContinueMethod() Be sure to release the object reference you placed on the secondary form. ThisForm.ParentForm = .NULL.
Then, in your ParentForm.ContinueMethod be sure the form is still visible before processing anything.
There's also BindEvent that can help with these things too.
Tracy Pearson PowerChurch Software
Thanks Tracy - making the form modal solved that problem. Now I have another but I will start another thread if I can't figure it out.
Joe
On Tue, Feb 23, 2016 at 2:07 PM, Tracy Pearson tracy@powerchurch.com wrote:
Joe Yoder wrote on 2016-02-23:
Thanks guys for the input.
The statistics method calls the form refresh already. I was confident
that
DOEVENTS would solve the problem but including one before calling and
one
every other line inside the method had no apparent effect.
I have not tried the timer - it seems like overkill but I did try a wait window before calling the statistics method. For some reason the wait window did not seem to show up.
I just now caught what is happening - the wait window comes up at the
same
time the secondary form comes up. That means the code after calling the form executes right away so I expect the solution is stop execution
until
the secondary form is exited. How do I do that?
Joe
Joe,
One way is to make the secondary form Modal.
Another way is to pass an object reference of the first form to the second form. It is received in Init. Do form secondary with thisform
Save the object reference passed to the Init to a property of the secondary form. In the Destroy event, call a method of the first form to continue processing. ThisForm.ParentForm.ContinueMethod() Be sure to release the object reference you placed on the secondary form. ThisForm.ParentForm = .NULL.
Then, in your ParentForm.ContinueMethod be sure the form is still visible before processing anything.
There's also BindEvent that can help with these things too.
Tracy Pearson PowerChurch Software
[excessive quoting removed by server]