Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem Opening Forms From Menu

Status
Not open for further replies.

taqmeena

Programmer
Mar 22, 2005
53
PK
when a Form is opened From The Menu.(Till it is open)
Then User Can open Any Other Form from Menu Except The Form That is Not Closed yet.

what should i do.
 
What sort of menu is it? A standard one attached to the forms or some other? Are you saying you only want to open a single form at a time?
 
I Have Made a Menu using Menu Editor which Runs With The Help of Blank Form.
i have given the Path of This Menu in The Form Menu Module Property of All The Forms i Designed.

i can open multiple Forms but not repeating.
if a Form named "abc" is opened then another Form "DEF" should be open From Menu Not "ABC" again.

Problem is "ABC" must not Be Open Untillit is Closed.
if Closed Then on Opening This Form SHould open.

i Tried ( Set_menu_item_property to On off) this works when i use only one form at a time.
when i open two forms The Property Changes. and That Forms Link in Menu Got Enabled of The DeActivated Form.

 
I Think Each Form Uses Its Own Menu.(same one but seperately)
Can We Make One Menu and That Work with All Forms as Single Menu.
 
To open a form with the same menu you have to use CALL_FORM. Unfortunately a limitation of this is that this only allows a single-form interface. OPEN_FORM is what you need for multiple-form applications, but there is no option to use the same menu with this command.

Instead, you may have to create an array of global variables that come into existence when a form is opened, and are deleted when the form is exited. Each new form that opens will test for the existence of those global variables and disable menu items accordingly.

Another method of passing data between forms in the same session is to create a record group in global scope, and you could use this to store the names of open forms.

Of course, you would also need to trap WHEN-FORM-NAVIGATE and/or WHEN-WINDOW-ACTIVATED so that forms already open can activate or deactivate menu items as required.

Its an interesting challenge, but an alternative method to using menus is to create your own using a tree item....
 
Thanks <<LEWISP>>.
I HAVE SOLVED THIS PROBLEM BY WRITING THE CODE BELOW IN THE <<MENU_ITEM_CODE>> FROM WHERE WE CALL A FORM. AND I GOT SUCCESS IN MY ATTEMPT NOW NO DUPLICATE FORM IS OPENED.
HERE IS THE SOLUTION
<< WRITE IT IN THE PL/SQL EDITOR OF MENU_ITEM >>
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

DECLARE
FORM_ID FORMMODULE := FIND_FORM('FORM_NAME');
FORM_STATUS VARCHAR2(50) := TO_CHAR(FORM_ID.ID);
BEGIN
IF FORM_STATUS IS NOT NULL THEN
GO_FORM(FORM_ID);
ELSE
OPEN_FORM('PATH_OF_FORM\FORM_NAME.FMX');
END IF;
END;

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Now Problem i Faced is when working with Multiple Forms.
i open Form1 i make changes in it. < yet i have not entered all the Required Fileds.
I open Another Form named Form2.
i make changes in it and Try To COMMIT it.

AN ERROR OCCURED << UNABLE TO INSERT >>
BECAUSE Form1 has some Fields Left Blank. Here Form1 disallowed to Enter Data when i was on Form2.

main Problem is COMMIT statement Attempts to Save Both Forms.
But My Requirement is to Save Only The Current Active Form.
I Tried The WHEN-WINDOW-ACTIVATED & DEACTIVATED TRIGGERS TO Set The Form Validateion Property to Propert_on & Property_off< and Also The Block Property UPDATE_ALLOWED, INSERT_ALLOWED). in WHEN-WINDOW-ACTIVATED & DEACTIVATED TRIGGERS
But It Did Not Worked.

Kindly Give Me The Solution That When i Fire Commit Statement only The Active Form Should Be Committed. Not The Form Which is Deactivated.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top