Re: Using Open_Form w/o full path

From: DanHW <danhw_at_aol.com>
Date: 16 Oct 1999 03:36:19 GMT
Message-ID: <19991015233619.20300.00000078_at_ng-cf1.aol.com>


>I am developing some forms using Forms 4.5. I have a main screen that
>has buttons that can be used to call the other forms. I am trying to
>use the OPEN_FORM command, but am having difficulty. It works fine if
>I put the entire path in the trigger, but if i just put the form's
>name, it gives me an error that it can't open the form. These forms
>will eventually be put on the client's server, and the paths will all
>be different. It would be a mess if I need to use the full path, as I
>will need to change them all later. Can someone give me a clue as to
>what the easiest way/standard way of calling forms from another form
>is?
>
>Thanks a bunch!!!
>KRM
>

One method often suggested is to put the path in the Registry in the FORMS45_PATH. That is not really a good option because the path gets long, and if the same same form name exists in multiple directories (ie, test and production), it will pick up the wrong one (Murphy's Law). This is really difficult to identify when some user says their form isn't working and you KNOW they have the latest version... Also many sys admin type frown upon us monkeying around in the registry....

What I do is us relative directory paths. If you can control the subdirectory structure, create all your apps from a common point, and reference the forms, menus, plls, reports based on that.

Suppose we have

app1

...formsdir
...rptsdir
...utildir
...menudir

app2
...formsdir
...rptsdir
...utildir
...menudir

I can open a form, with the working directory set as <anydrive>/app2/formsdir

Then, to open a form in the utildir, i just say open_form('..\utildir\formname'); The .. says go up one level, <putting us at app2>, then go to the utildir directory, and look for the form.

Likewise for reports and menus and PLLs. Obviously for this to work, you need to develop in the same kind of directory structure. When you include a PLL in a form, you will need to edit the name so it is in the right form, and tell Form not to strip off the directory.

This has been very successful for me; hopefully it will work for you also.

Dan Hekimian-Williams Received on Sat Oct 16 1999 - 05:36:19 CEST

Original text of this message