loop script delete records error 101
I am trying to write a a script that deletes child records. The problem I'm having is that the loop exits after deleteing 2 records everytime regardless of how many records there are. The script debugger show error 101(record is missing)
the script looks like this.
show custom dialog (are you sure you want to delete customer and all associated students?
if (get(lastmessagechoice)= 2)
Go to related record (show only related records from Table "Students" Usiing layout Students Form"
go to record/request/page [first]
delete record/request (no dialog)
Go To Record [Next ; Exit after last]
Any help would be appreciated