Opening Add/Edit Forms in Model window

I have an application I am using tabs in. Each tab is a different table which gets linked behind the scenes later as a whole for the user. The second of two tabs that are displayed is called, ’ Ingredients’. This tab loads a form, (Form_RecipeEditor_Ingredients), with a Master/Detail relationship. At the top are the basics of the selected recipe and the Detail is an Editable Grid View form, (Form_IngredientsList), that lists ALL of the Ingredients associated with the selected recipe. So far so good.

The user can ‘Add’ a new ingredient, Edit or Delete a selected ingredient. The toolbar of the Ingredients list shows an Add button which opens a form called, (Form_IngredientsEditor). Each Ingredient in the Editable Grid View has an Edit and Delete image linked to the same, (Form_IngredientsEditor), form’. All of the Add, Edit, and Delete functions work as I want them to. After the Add, Edit or Delete action the Ingredients List is updated.

Here is my issue. I wanted the form, (Form_IngredientsEditor), to open in a model window and then close when the changes were completed and return back to the Ingredients tab with the changes showing in the Editable Grid View.

I opted for an approach that uses a control application that sets some global variables BEFORE the form (Form_IngredientsEditor), is opened. These forms are; Control_Ingredient_Add, Control_Ingredient_Edit, and Control_Ingredient_Delete, respectively.
To accomplish this once the button on the, (Form_IngredientsList), form is clicked the desired control application is loaded in a Model window. The control application sets global variables and then redirects from the onLoad event with:

sc_redir(Form_IngredientsEditor,ID=[var_iSelectedIndex], ‘_self’, 800, 400);

The ‘self’ parameter is used because each of the three LINKs, Add, Edit, and Delete set up Model as the target form. This works great for the Edit and Delete control applications, but for the Add control application a totally new window is open onscreen when I use:

if ([var_sFormAction] == ‘Add’)
{
sc_apl_conf(“Form_IngredientsEditor”, “start”, “new”);
}

This command seams to open yet another window onscreen which is not model at all. The Add still works, but my display of the original form, (Form_RecipeEditor_Ingredients), is messed up. It appears in its own window separate from the tab application where it should be.

Can I set a form to Insert mode without opening any new window. If the form would open in the same window being in Insert mode that would solve the problem.

Any ideas please?? Thank you so much!