I have several forms that I have opened using form.show()
what would be the best way to reference and then close them programatically?
assuming there is no fixed order or choice, I would keep an array with form name + instance identifier and form object references as columns in each row of the array.. The reason for an instance identifier (e.g., <form name> + guid() is for specific identification if a form can be opened more than once.. Then, you can use the array to close all of them. And if a form is closed manually, you can use the form+guid() property on the form to delete the row of the array, which will release the object reference there.