>Ok Liam...
>
>The other query:
>
>&& Delete type's holidays.
>Delete From BuyHolidays Where idBuy == BuyType.idBuy
>Delete In BuyType
>
>&& Go to top and reload the holidays.
>Go Top In BuyType
>Select * From BuyHoliDays ;
> Into Cursor curHolidays ;
> Where idBuy == BuyType.idBuy And !Deleted('BuyHoliDays')
>...
>...
>After this, the curHolidays is empty, but if I quit of the form and open it again the query work fine. And there are more than one Holiday in the table for the first BuyType (go top).
Is your code running in a private datasession? SET DELETED is scoped to the data session, so just doing SET DELETED ON in your main program, and then running your code in a private datasession will not do what you expect. It's better to use SET DELETED (scoped properly), but in this case you could just use DELETED() in your query without specifing the alias. That will work as long as the SELECT is only operating on a single table. Specifying the alias will NOT work. See the help for "SELECT - SQL" for more details.