It would be helpful if you used pre and /pre around your code. But nit picking aside, wrap your code between lockscreens:
thisform.lockscreen = .t.
tf.refresh()
local nd,nc,oldstopon
oldstopon=cust.stopon
nc=makecode('next','pay',tf.mypf.page2.dExtenddays.value - DATE())
if LEN(ALLTRIM(nc))>0
this.Parent.sb1.Value=nc
this.Parent.sb1.refresh()
cust_fnd.passtimecode=nc
replace passtimecode with nc in cust
replace stopon with this.Parent.dextenddays.Value in cust
select cust
=TABLEUPDATE(.f.)
cust_fnd.passtimecode='99999999'
this.Parent.sb1.refresh()
endif
thisform.lockscreen = .f.
Glenn
>I have code in the click event of a button:
>this.Enabled=.f.
>tf.refresh()
>local nd,nc,oldstopon
>oldstopon=cust.stopon
>nc=makecode('next','pay',tf.mypf.page2.dExtenddays.value - DATE())
>if LEN(ALLTRIM(nc))>0
> this.Parent.sb1.Value=nc
> this.Parent.sb1.refresh()
> cust_fnd.passtimecode=nc
> replace passtimecode with nc in cust
> replace stopon with this.Parent.dextenddays.Value in cust
> select cust
> =TABLEUPDATE(.f.)
> cust_fnd.passtimecode='99999999'
> this.Parent.sb1.refresh()
>endif
>************
>The problem is that on some machines the screen does not refresh with the codes generated by the makecode function nor does the button disable itself. That function connects to an Access Database reads from one table and writes to several tables. The codes do get generated. You will note that I have scatter refreshes liberally throughout the code.