If lshiftuppagetworecurringcharges=.T. LOCATE For Strextract(ps,'(',')')='RecurringCharges' And PageNo=2 If Found () nrecurringchargesposr=posr Select Distinct posr From pagetwo Order By posr Desc Into Cursor distinctposr Locate For posr=nrecurringchargesposr Skip-1 ncommondifferenceforrecurringchargesposr=posr-nrecurringchargesposr-10 Select pagetwo Replace All posr With posr+ncommondifferenceforrecurringchargesposr For posr<=nrecurringchargesposr Endif EndifMy problem is that if the first instance of my required text i.e 'RecurringCharges' in the above case is found True, my Code is executed. However I have many other records later in my cursor for which I have Strextract(ps,'(',')')='RecurringCharges' And the above code does not locates and executes all the 'RecurringCharges'