return to form that is already open

If a form is already open I want to return to this form not open the same form again. Below is how I tried to do this but it does not work.

Who is Participating?
jtriftsConnect With a Mentor MI and AutomationCommented:
It depends on how you've navigated to the form you're in, in the first place.  Consider that there are three ways to invoke a form:

If you have got to FORM2 by invoking a call_form('FORM2'), then you are effectively creating a call stack.  I.E.
FORM1--> FORM2--> FORM3-->...FORMnn.

Implemented this way, a close_form for the current form (or indeed an exit_form) will send you back to the next form on the stack.  Then you don't have to specify what form you want to return to at all.

One of the things that this highlights is that design is important.  The flow of work and the way users are intended to proceed through the forms is important.

The call_form for example, though it will create a handy call stack, will also disable the other forms until the current form is dismissed, returning you to the previous form on the stack.

NEW_FORM will let you replace one form with another, while OPEN_FORM let's you open one after the other again ad again, often letting you open multiple instances of the same form.
another thing to think about is whther or not the work done in the next form is necessarily part of the same transaction.  If not, you do have the option of opening forms in different sessions (and hence different transactions)...but I digress...

SO back to your specific question:

the use of go_form is correct, however I suspect you are referencing the FMX name rather than the form name...

GO_FORM(form_name);  Here FORM_NAME is the name of the target form.  The data type of name is VARCHAR2. NOTE: The GO_FORM built-in attempts to search for the form module name, not the name of the .fmx file. (Check in the object navigator to see if the form label (which defaults to MODULE1 for newly created forms) is the same as the name you are passing...

maryebAuthor Commented:
Yes, I had GO_FORM(form name of the .fmx file);
It works fine with GO_FORM(module name);


I have a search form, where the user enters a pid and data is displayed on this form relating to that pid. Then the user clicks the button More, if they want to see further information about this pid. This brings the user to another form that displays further information.

Now if the user returns back to the search screen and enters a different pid I want the user to be able to see further information on this pid if they wish, but I can't do this as with the code below I am asking it to go to the form if it is already open. If I remove this code (GO_FORM('FORM2');) and the user enters the same pid into the search form for the second time a new form will be opened displaying information relating to this pid. Therefore two forms will be opened with the exact same data, I want it to go to the form if the pid is the same.


Is there another way around this problem.

jtriftsMI and AutomationCommented:
OK.  Let me see if I have this straight.

Form1 = search form.
Form2 = results form.

Run Form 1. Enter query detail (PID). Press Search Button.
IF FORM2 already open with same PID, go to the FORM2.
IF FORM2 NOT OPEN or FORM 2 is open but PID is different, open a new instance of FORM2.

Is this what your requirements are?

IF so, I'll post a follow-up...
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

maryebAuthor Commented:
maryebAuthor Commented:

The above comment is what I am looking for........any update.
jtriftsMI and AutomationCommented:
Sorry Mary...have been busy...I'm not certain...

And you haven't yet told me why you're so keen on keeping this as a two form approach...especially when most think that this might be an inappropriate design...

I'll try to ge tback to you when I can, but am swamped with other things at the mo...


maryebAuthor Commented:
I now have

Form1 where I enter my search criteria(PID), then my search data relating to this criteria is displayed on the same form(Form1).

In Form1 I may have a number of records displayed. So now to see even more information relating to the PID entered I have a button called MORE which opens a new form(Form2) with additional information.

This is why I still need a solution to the above.
jtriftsMI and AutomationCommented:
This could still be done within the same form either on another canvas, or within another window...
Please update and finalize this old, open question. Please:

1) Award points ... if you need Moderator assistance to split points, comment here with details please or advise us in Community Support with a zero point question and this question link.
2) Ask us to delete it if it has no value to you or others
3) Ask for a refund so that we can move it to our PAQ at zero points if it did not help you but may help others.



** Mindphaser - Community Support Moderator **

P.S.  Click your Member Profile, choose View Question History to go through all your open and locked questions to update them.
jtriftsMI and AutomationCommented:
either points to jtrifts or delete the question.
Thanks, JT, points clearly to you. :)
Moondancer - EE Moderator
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.