Form not updating inside loop

Moderator: Rathinagiri

Post Reply
User avatar
RussBaker
Posts: 51
Joined: Wed Jul 22, 2015 9:44 am

Form not updating inside loop

Post by RussBaker »

I am trying to display a status via the "main.Text_msg1" value to the user as well as a status bar.
However, inside the do while loop there is no update to the form.
Is there some kind of refresh that needs to take place inside the loop?

Code: Select all

Func CHKEM()
   local p:=10
   local c:=0
   local t:=0
   main.Text_msg1.visible :=.t.
   main.Text_msg1.value :="Verifying..."
     
   set filter to type="E" .and. status < "7" 
   go top

   do while !eof()

      p++
      If P>1000
        p=0
      Endif
      main.progressbar_1.value := p
      c++
      t=t+amount
      skip
   Enddo
   main.progressbar_1.visible := .f.
   main.Text_msg1.visible := .f.
   main.Text_msg1.value :=""
   msgbox({"Unpaid  due between "+dtoc(main.datepicker_1.value) + " and " + dtoc(main.datepicker_2.value) +chr(13)+ "Total Bills "+ str(c)+ chr(13) + "Total Amount   "+ transform(t,"$99,999.99")}, "Verify" ) 
Return
User avatar
srvet_claudio
Posts: 2193
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: Form not updating inside loop

Post by srvet_claudio »

Hi RussBaker,
Insert at inside of loop:

DO EVENTS
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
Post Reply