To elaborate on that, it will never be a procedure window unless you go well out of your way to make that happen, either by using a
window statement or the
openprocedure statement. If you have a procedure window open and press the Run button, Panorama will first find the topmost data window in the database (either the data sheet or a form) and make that active, then run the code. If there is no data window open, Panorama will complain and refuse to run the code.
If you do purposely make a procedure window active in your code, most normal database related statements won't work. You can't sort, select, add records, etc. None of those operations are valid when a procedure window is frontmost. In fact there are only a few statements that you can use --