My form code can be run when the form is open or when it is not. How do I test for the form being open?