Hi David,
Your question is formed from the wrong point of view.
Rather -
a) always open, and close files where you need them to be opened & closed.
b) the current form record is stored in the session queue when the form is generated.
Remember the form procedure is not "called once". It's not a "windows" type procedure. Rather it is called many times. Many times it is called on different threads, during the life of a "form" (as seen by the user in a browser.
Cheers
Bruce