How can you tell if a form is opened or not

I have 2 forms, Form1 and Form2. Now here is the complex part: When Form1 is opened, it calls Form2. Data is passed by clicking a button on Form2 to Form1. That is, Form2 is called from Form1. What is if I have Form2 opened alone and I still want to pass data to Form1? How can I tell if the user calls Form2 from Form1 or just plainly calls Form2? Confusing isn’t it?

You can try the following piece of code in Form2 if (element.args().caller()) { //if called from Form1 … } else { //if called plainly … }

Thanks much. [:)] I need to read up more on the args class.