The problem seems to be with the generation of this code, but I'm not sure why it's being generated, since the user is logged in:
If p_web.GetSessionLoggedIn() = 0
Return -1
End
And it is on the browse, not the form.
It does delete the record, but gives the Page not found white window. If I hit backspace, the record is deleted. The next deletes work fine.
It also deletes records on the first page that appears, but not records on subsequent pages, after hitting the Next or Last buttons.